Trait distant_core::Codec[][src]

pub trait Codec: for<'a> Encoder<&'a [u8], Error = Error> + Decoder<Item = Vec<u8>, Error = Error> + Clone {
    fn encode(&mut self, item: &[u8], dst: &mut BytesMut) -> Result<()>;
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Vec<u8>>>; }
Expand description

Represents abstraction of a codec that implements specific encoder and decoder for distant

Required methods

Implementors