Codec

Trait Codec 

Source
pub trait Codec<T>:
    Send
    + Sync
    + 'static {
    type Error: Error + Send;

    // Required methods
    fn decode(&self, bytes: Bytes) -> Result<T, Self::Error>;
    fn encode(&self, msg: &T) -> Result<Bytes, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn decode(&self, bytes: Bytes) -> Result<T, Self::Error>

Source

fn encode(&self, msg: &T) -> Result<Bytes, Self::Error>

Implementors§