Trait mqtt::packet::Packet
[−]
[src]
pub trait Packet<'a>: Sized { type Payload: Encodable<'a> + Decodable<'a> + 'a; fn fixed_header(&self) -> &FixedHeader; fn payload(&self) -> &Self::Payload; fn encode_variable_headers<W: Write>(&self,
writer: &mut W)
-> Result<(), PacketError<'a, Self>>; fn encoded_variable_headers_length(&self) -> u32; fn decode_packet<R: Read>(reader: &mut R,
fixed_header: FixedHeader)
-> Result<Self, PacketError<'a, Self>>; }
Associated Types
Required Methods
fn fixed_header(&self) -> &FixedHeader
fn payload(&self) -> &Self::Payload
fn encode_variable_headers<W: Write>(&self,
writer: &mut W)
-> Result<(), PacketError<'a, Self>>
writer: &mut W)
-> Result<(), PacketError<'a, Self>>
fn encoded_variable_headers_length(&self) -> u32
fn decode_packet<R: Read>(reader: &mut R,
fixed_header: FixedHeader)
-> Result<Self, PacketError<'a, Self>>
fixed_header: FixedHeader)
-> Result<Self, PacketError<'a, Self>>
Implementors
impl<'a> Packet<'a> for ConnectPacket
impl<'a> Packet<'a> for ConnackPacket
impl<'a> Packet<'a> for PublishPacket
impl<'a> Packet<'a> for PubackPacket
impl<'a> Packet<'a> for PubrecPacket
impl<'a> Packet<'a> for PubrelPacket
impl<'a> Packet<'a> for PubcompPacket
impl<'a> Packet<'a> for PingreqPacket
impl<'a> Packet<'a> for PingrespPacket
impl<'a> Packet<'a> for DisconnectPacket
impl<'a> Packet<'a> for SubscribePacket
impl<'a> Packet<'a> for SubackPacket
impl<'a> Packet<'a> for UnsubackPacket
impl<'a> Packet<'a> for UnsubscribePacket