Codec

Trait Codec 

Source
pub trait Codec: Framing {
    // Required methods
    fn encode<T: Serialize>(msg: &T) -> Result<Self::Buf>;
    fn decode<T: DeserializeOwned>(buf: &mut Self::Buf) -> Result<T>;
}

Required Methods§

Source

fn encode<T: Serialize>(msg: &T) -> Result<Self::Buf>

Source

fn decode<T: DeserializeOwned>(buf: &mut Self::Buf) -> Result<T>

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§