Struct for_mqtt_client::protocol::FixedHeader
source · 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, PacketParseError>
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
pub fn remaining_len(&self) -> usize
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<FixedHeader> for FixedHeader
impl PartialEq<FixedHeader> for FixedHeader
source§fn eq(&self, other: &FixedHeader) -> bool
fn eq(&self, other: &FixedHeader) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<FixedHeader> for FixedHeader
impl PartialOrd<FixedHeader> for FixedHeader
source§fn partial_cmp(&self, other: &FixedHeader) -> Option<Ordering>
fn partial_cmp(&self, other: &FixedHeader) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more