DecodePacket

Trait DecodePacket 

Source
pub trait DecodePacket<'a>: Sized {
    // Required method
    fn decode(
        buf: &'a [u8],
        version: MqttVersion,
    ) -> Result<Self, MqttError<ErrorPlaceHolder>>;
}
Expand description

A trait for packets that can be decoded from a byte buffer.

Required Methods§

Source

fn decode( buf: &'a [u8], version: MqttVersion, ) -> Result<Self, MqttError<ErrorPlaceHolder>>

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<'a> DecodePacket<'a> for ConnAck<'a>

Source§

impl<'a> DecodePacket<'a> for Connect<'a>

Source§

impl<'a> DecodePacket<'a> for Disconnect<'a>

Source§

impl<'a> DecodePacket<'a> for PubAck<'a>

Source§

impl<'a> DecodePacket<'a> for Publish<'a>

Source§

impl<'a> DecodePacket<'a> for SubAck<'a>

Source§

impl<'a> DecodePacket<'a> for Subscribe<'a>