pub struct NNFrame {
pub header: NNHeader,
pub body: Bytes,
pub ex_head: Bytes,
}Expand description
内部协议帧
Fields§
§header: NNHeader§body: Bytes§ex_head: Bytes服务端下发的扩展头原始字节(FtnnExtendHead protobuf) 关键用途:body 为空时,服务端通常把业务错误塞在 ex_head.err_info 里
Implementations§
Source§impl NNFrame
impl NNFrame
Sourcepub fn parse_ex_head_error(&self) -> Option<ExHeadErrorInfo>
pub fn parse_ex_head_error(&self) -> Option<ExHeadErrorInfo>
从 ex_head 里提取 err_info(field 5 = ErrorInfo nested message) 如果 ex_head 为空或没 err_info 字段,返回 None。
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for NNFrame
impl RefUnwindSafe for NNFrame
impl Send for NNFrame
impl Sync for NNFrame
impl Unpin for NNFrame
impl UnsafeUnpin for NNFrame
impl UnwindSafe for NNFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more