pub struct FixedHeader { /* private fields */ }Expand description
Packet type from a byte
ⓘ
7 3 0
+--------------------------+--------------------------+
byte 1 | MQTT Control Packet Type | Flags for each type |
+--------------------------+--------------------------+
| Remaining Bytes Len (1/2/3/4 bytes) |
+-----------------------------------------------------+
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Figure_2.2_-Implementations§
Source§impl FixedHeader
impl FixedHeader
pub fn new( byte1: u8, remaining_len_len: usize, remaining_len: usize, ) -> FixedHeader
pub fn packet_type(&self) -> Result<PacketType, Error>
Sourcepub fn frame_length(&self) -> usize
pub fn frame_length(&self) -> usize
Returns the size of full packet (fixed header + variable header + payload) Fixed header is enough to get the size of a frame in the stream
Auto Trait Implementations§
impl Freeze for FixedHeader
impl RefUnwindSafe for FixedHeader
impl Send for FixedHeader
impl Sync for FixedHeader
impl Unpin for FixedHeader
impl UnsafeUnpin for FixedHeader
impl UnwindSafe for FixedHeader
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