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

type Payload: Encodable<'a> + Decodable<'a> + 'a

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>>

fn encoded_variable_headers_length(&self) -> u32

fn decode_packet<R: Read>(reader: &mut R, fixed_header: FixedHeader) -> Result<Self, PacketError<'a, Self>>

Implementors