pub struct Header(/* private fields */);Expand description
Validated frame header byte.
Implementations§
Source§impl Header
impl Header
Sourcepub const fn new(tid: u8) -> Option<Self>
pub const fn new(tid: u8) -> Option<Self>
Build a header for the given transaction identifier.
Returns None if tid exceeds TID_MAX.
Sourcepub const fn from_byte(byte: u8) -> Option<Self>
pub const fn from_byte(byte: u8) -> Option<Self>
Validate a received header byte.
Returns None when the FLG pattern does not match (the frame
is not a ULCP frame) or a reserved bit is set (the
frame must be ignored).
pub const fn to_byte(self) -> u8
pub const fn tid(self) -> u8
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)