Struct mqtt::control::fixed_header::FixedHeader [−][src]
pub struct FixedHeader { pub packet_type: PacketType, pub remaining_length: u32, }
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.
Methods
impl FixedHeader
[src]
impl FixedHeader
pub fn new(packet_type: PacketType, remaining_length: u32) -> FixedHeader
[src]
pub fn new(packet_type: PacketType, remaining_length: u32) -> FixedHeader
pub fn parse<A: AsyncRead>(
rdr: A
) -> impl Future<Item = (A, Self, Vec<u8>), Error = FixedHeaderError>
[src]
pub fn parse<A: AsyncRead>(
rdr: A
) -> impl Future<Item = (A, Self, Vec<u8>), Error = FixedHeaderError>
Asynchronously parse a single fixed header from an AsyncRead type, such as a network socket.
Trait Implementations
impl Debug for FixedHeader
[src]
impl Debug for FixedHeader
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for FixedHeader
[src]
impl Clone for FixedHeader
fn clone(&self) -> FixedHeader
[src]
fn clone(&self) -> FixedHeader
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for FixedHeader
[src]
impl Copy for FixedHeader
impl Eq for FixedHeader
[src]
impl Eq for FixedHeader
impl PartialEq for FixedHeader
[src]
impl PartialEq for FixedHeader
fn eq(&self, other: &FixedHeader) -> bool
[src]
fn eq(&self, other: &FixedHeader) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &FixedHeader) -> bool
[src]
fn ne(&self, other: &FixedHeader) -> bool
This method tests for !=
.
impl Encodable for FixedHeader
[src]
impl Encodable for FixedHeader
type Err = FixedHeaderError
fn encode<W: Write>(&self, wr: &mut W) -> Result<(), FixedHeaderError>
[src]
fn encode<W: Write>(&self, wr: &mut W) -> Result<(), FixedHeaderError>
Encodes to writer
fn encoded_length(&self) -> u32
[src]
fn encoded_length(&self) -> u32
Length of bytes after encoded
impl Decodable for FixedHeader
[src]
impl Decodable for FixedHeader
type Err = FixedHeaderError
type Cond = ()
fn decode_with<R: Read>(
rdr: &mut R,
_rest: Option<()>
) -> Result<FixedHeader, FixedHeaderError>
[src]
fn decode_with<R: Read>(
rdr: &mut R,
_rest: Option<()>
) -> Result<FixedHeader, FixedHeaderError>
Decodes object with additional data (or hints)
fn decode<R: Read>(reader: &mut R) -> Result<Self, Self::Err>
[src]
fn decode<R: Read>(reader: &mut R) -> Result<Self, Self::Err>
Decodes object from reader
Auto Trait Implementations
impl Send for FixedHeader
impl Send for FixedHeader
impl Sync for FixedHeader
impl Sync for FixedHeader