Trait Encodable

Source
pub trait Encodable {
    // Required methods
    fn encode<W: SyncWrite>(&self, writer: &mut W) -> Result<(), Error>;
    fn encode_len(&self) -> usize;
}
Expand description

The ability of encoding type into write trait, and calculating encoded size.

Required Methods§

Source

fn encode<W: SyncWrite>(&self, writer: &mut W) -> Result<(), Error>

Encode type into writer

Source

fn encode_len(&self) -> usize

Calculate the encoded size.

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 Encodable for Protocol

Source§

impl Encodable for mqtt_proto::v3::Connect

Source§

impl Encodable for mqtt_proto::v3::LastWill

Source§

impl Encodable for mqtt_proto::v3::Publish

Source§

impl Encodable for mqtt_proto::v3::Suback

Source§

impl Encodable for mqtt_proto::v3::Subscribe

Source§

impl Encodable for mqtt_proto::v3::Unsubscribe

Source§

impl Encodable for Auth

Source§

impl Encodable for AuthProperties

Source§

impl Encodable for Connack

Source§

impl Encodable for ConnackProperties

Source§

impl Encodable for mqtt_proto::v5::Connect

Source§

impl Encodable for ConnectProperties

Source§

impl Encodable for Disconnect

Source§

impl Encodable for DisconnectProperties

Source§

impl Encodable for mqtt_proto::v5::LastWill

Source§

impl Encodable for Puback

Source§

impl Encodable for PubackProperties

Source§

impl Encodable for Pubcomp

Source§

impl Encodable for PubcompProperties

Source§

impl Encodable for mqtt_proto::v5::Publish

Source§

impl Encodable for PublishProperties

Source§

impl Encodable for Pubrec

Source§

impl Encodable for PubrecProperties

Source§

impl Encodable for Pubrel

Source§

impl Encodable for PubrelProperties

Source§

impl Encodable for mqtt_proto::v5::Suback

Source§

impl Encodable for SubackProperties

Source§

impl Encodable for mqtt_proto::v5::Subscribe

Source§

impl Encodable for SubscribeProperties

Source§

impl Encodable for Unsuback

Source§

impl Encodable for UnsubackProperties

Source§

impl Encodable for mqtt_proto::v5::Unsubscribe

Source§

impl Encodable for UnsubscribeProperties

Source§

impl Encodable for WillProperties