pub struct Codec { /* private fields */ }
Expand description
Mqtt v3.1.1 protocol codec
Implementations§
Trait Implementations§
source§impl Decoder for Codec
impl Decoder for Codec
§type Error = DecodeError
type Error = DecodeError
The type of unrecoverable frame decoding errors. Read more
source§fn decode(&self, src: &mut BytesMut) -> Result<Option<Self::Item>, DecodeError>
fn decode(&self, src: &mut BytesMut) -> Result<Option<Self::Item>, DecodeError>
Attempts to decode a frame from the provided buffer of bytes.
§fn decode_vec(
&self,
src: &mut BytesVec
) -> Result<Option<Self::Item>, Self::Error>
fn decode_vec(
&self,
src: &mut BytesVec
) -> Result<Option<Self::Item>, Self::Error>
Attempts to decode a frame from the provided buffer of bytes.
source§impl Encoder for Codec
impl Encoder for Codec
§type Error = EncodeError
type Error = EncodeError
The type of encoding errors.
source§fn encode(&self, item: Self::Item, dst: &mut BytesMut) -> Result<(), EncodeError>
fn encode(&self, item: Self::Item, dst: &mut BytesMut) -> Result<(), EncodeError>
Encodes a frame into the buffer provided.
§fn encode_vec(
&self,
item: Self::Item,
dst: &mut BytesVec
) -> Result<(), Self::Error>
fn encode_vec(
&self,
item: Self::Item,
dst: &mut BytesVec
) -> Result<(), Self::Error>
Encodes a frame into the buffer provided.