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) |
+-----------------------------------------------------+
<https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc385349207>
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
Trait Implementations§
Source§impl Clone for FixedHeader
impl Clone for FixedHeader
Source§fn clone(&self) -> FixedHeader
fn clone(&self) -> FixedHeader
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FixedHeader
impl Debug for FixedHeader
Source§impl PartialEq for FixedHeader
impl PartialEq for FixedHeader
Source§impl PartialOrd for FixedHeader
impl PartialOrd for FixedHeader
impl Copy for FixedHeader
impl Eq for FixedHeader
impl StructuralPartialEq for FixedHeader
Auto Trait Implementations§
impl Freeze for FixedHeader
impl RefUnwindSafe for FixedHeader
impl Send for FixedHeader
impl Sync for FixedHeader
impl Unpin 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