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
sourceimpl FixedHeader
impl FixedHeader
pub fn new(packet_type: PacketType, remaining_length: u32) -> FixedHeader
Trait Implementations
sourceimpl Clone for FixedHeader
impl Clone for FixedHeader
sourcefn clone(&self) -> FixedHeader
fn clone(&self) -> FixedHeader
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FixedHeader
impl Debug for FixedHeader
sourceimpl Decodable for FixedHeader
impl Decodable for FixedHeader
type Error = FixedHeaderError
type Cond = ()
sourcefn 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)
sourceimpl Encodable for FixedHeader
impl Encodable for FixedHeader
sourceimpl PartialEq<FixedHeader> for FixedHeader
impl PartialEq<FixedHeader> for FixedHeader
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &FixedHeader) -> bool
fn ne(&self, other: &FixedHeader) -> bool
This method tests for !=
.
impl Copy for FixedHeader
impl Eq for FixedHeader
impl StructuralEq for FixedHeader
impl StructuralPartialEq for FixedHeader
Auto Trait Implementations
impl RefUnwindSafe for FixedHeader
impl Send for FixedHeader
impl Sync for FixedHeader
impl Unpin for FixedHeader
impl UnwindSafe for FixedHeader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more