pub struct Header {
pub flags: Flags,
pub frame_num: FrameNum,
pub data_len: u32,
}Expand description
Header of a frame.
Fields§
§flags: FlagsFrame flags.
frame_num: FrameNumFrame number.
data_len: u32Data length.
Implementations§
Source§impl Header
impl Header
Sourcepub fn try_parse(bytes: &[u8]) -> Result<Result<Self, Wants>, HeaderError>
pub fn try_parse(bytes: &[u8]) -> Result<Result<Self, Wants>, HeaderError>
Try to parse a header from bytes.
This method will try to parse a header from the first bytes of bytes. Returns:
Ok(None)ifbytesdoes not contain enough data to form a header,Ok(Some(header))if a header could be successfully parsed from bytes,Err(...)if there was an error while parsing the header
Trait Implementations§
impl Copy for Header
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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