Trait mqtt::encodable::Encodable [−][src]
pub trait Encodable { type Err: Error; fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Self::Err>; fn encoded_length(&self) -> u32; }
Methods for encoding an Object to bytes according to MQTT specification
Associated Types
Required Methods
fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Self::Err>
Encodes to writer
fn encoded_length(&self) -> u32
Length of bytes after encoded
Implementations on Foreign Types
impl<'a> Encodable for &'a str
[src]
impl<'a> Encodable for &'a str
type Err = StringEncodeError
fn encode<W: Write>(&self, writer: &mut W) -> Result<(), StringEncodeError>
[src]
fn encode<W: Write>(&self, writer: &mut W) -> Result<(), StringEncodeError>
fn encoded_length(&self) -> u32
[src]
fn encoded_length(&self) -> u32
impl<'a> Encodable for &'a [u8]
[src]
impl<'a> Encodable for &'a [u8]
impl Encodable for String
[src]
impl Encodable for String
type Err = StringEncodeError
fn encode<W: Write>(&self, writer: &mut W) -> Result<(), StringEncodeError>
[src]
fn encode<W: Write>(&self, writer: &mut W) -> Result<(), StringEncodeError>
fn encoded_length(&self) -> u32
[src]
fn encoded_length(&self) -> u32
impl Encodable for Vec<u8>
[src]
impl Encodable for Vec<u8>
impl Encodable for ()
[src]
impl Encodable for ()
Implementors
impl Encodable for FixedHeader type Err = FixedHeaderError;
impl Encodable for PacketIdentifier type Err = VariableHeaderError;
impl Encodable for ProtocolName type Err = VariableHeaderError;
impl Encodable for ProtocolLevel type Err = VariableHeaderError;
impl Encodable for ConnectFlags type Err = VariableHeaderError;
impl Encodable for KeepAlive type Err = VariableHeaderError;
impl Encodable for ConnackFlags type Err = VariableHeaderError;
impl Encodable for ConnectReturnCode type Err = VariableHeaderError;
impl Encodable for TopicNameHeader type Err = VariableHeaderError;
impl Encodable for ConnectPacketPayload type Err = ConnectPacketPayloadError;
impl Encodable for SubscribePacketPayload type Err = SubscribePacketPayloadError;
impl Encodable for SubackPacketPayload type Err = SubackPacketPayloadError;
impl Encodable for UnsubscribePacketPayload type Err = UnsubscribePacketPayloadError;
impl<T: Packet + Debug> Encodable for T type Err = PacketError<T>;
impl Encodable for VariablePacket type Err = VariablePacketError;
impl Encodable for VarBytes type Err = Error;
impl Encodable for TopicFilter type Err = TopicFilterError;
impl Encodable for TopicName type Err = TopicNameError;