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 FixedHeaderpub fn new(packet_type: PacketType, remaining_length: u32) -> FixedHeader[src]
pub fn new(packet_type: PacketType, remaining_length: u32) -> FixedHeaderpub fn parse<A: AsyncRead>(
rdr: A
) -> impl Future<Item = (A, Self), Error = FixedHeaderError>[src]
pub fn parse<A: AsyncRead>(
rdr: A
) -> impl Future<Item = (A, Self), 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 FixedHeaderfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for FixedHeader[src]
impl Clone for FixedHeaderfn clone(&self) -> FixedHeader[src]
fn clone(&self) -> FixedHeaderReturns 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 FixedHeaderimpl Eq for FixedHeader[src]
impl Eq for FixedHeaderimpl PartialEq for FixedHeader[src]
impl PartialEq for FixedHeaderfn eq(&self, other: &FixedHeader) -> bool[src]
fn eq(&self, other: &FixedHeader) -> boolThis 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) -> boolThis method tests for !=.
impl Encodable for FixedHeader[src]
impl Encodable for FixedHeadertype 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) -> u32Length of bytes after encoded
impl Decodable for FixedHeader[src]
impl Decodable for FixedHeadertype 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 FixedHeaderimpl Sync for FixedHeader
impl Sync for FixedHeader