Trait PollHeader

Source
pub trait PollHeader {
    type Error;
    type Packet;

    // Required methods
    fn new_with(hd: u8, remaining_len: u32) -> Result<Self, Self::Error>
       where Self: Sized;
    fn build_empty_packet(&self) -> Option<Self::Packet>;
    fn block_decode(
        self,
        reader: &mut &[u8],
    ) -> Result<Self::Packet, Self::Error>;
    fn remaining_len(&self) -> usize;
    fn is_eof_error(err: &Self::Error) -> bool;
}

Required Associated Types§

Required Methods§

Source

fn new_with(hd: u8, remaining_len: u32) -> Result<Self, Self::Error>
where Self: Sized,

Source

fn build_empty_packet(&self) -> Option<Self::Packet>

Packet without body is empty packet

Source

fn block_decode(self, reader: &mut &[u8]) -> Result<Self::Packet, Self::Error>

Source

fn remaining_len(&self) -> usize

Source

fn is_eof_error(err: &Self::Error) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl PollHeader for mqtt_proto::v3::Header

Source§

impl PollHeader for mqtt_proto::v5::Header