Struct mqtt::control::fixed_header::FixedHeader
source · pub struct FixedHeader {
pub packet_type: PacketType,
pub remaining_length: u32,
}
Expand description
Fixed header for each MQTT control packet
Format:
7 3 0
+--------------------------+--------------------------+
| MQTT Control Packet Type | Flags for each type |
+--------------------------+--------------------------+
| Remaining Length ... |
+-----------------------------------------------------+
Fields§
§packet_type: PacketType
Packet Type
remaining_length: u32
The Remaining Length is the number of bytes remaining within the current packet, including data in the variable header and the payload. The Remaining Length does not include the bytes used to encode the Remaining Length.
Implementations§
source§impl FixedHeader
impl FixedHeader
pub fn new(packet_type: PacketType, remaining_length: u32) -> FixedHeader
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 Decodable for FixedHeader
impl Decodable for FixedHeader
type Error = FixedHeaderError
type Cond = ()
source§fn decode_with<R: Read>(
rdr: &mut R,
_rest: ()
) -> Result<FixedHeader, FixedHeaderError>
fn decode_with<R: Read>( rdr: &mut R, _rest: () ) -> Result<FixedHeader, FixedHeaderError>
Decodes object with additional data (or hints)
source§impl Encodable for FixedHeader
impl Encodable for FixedHeader
source§impl PartialEq for FixedHeader
impl PartialEq 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 ==
.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