Trait Codec

Source
pub trait Codec: Sized {
    // Required methods
    fn encode<W: Write>(&self, output: &mut W) -> Result<()>;
    fn decode<R: Read>(tag: u8, input: &mut R) -> Result<Self>;
}

Required Methods§

Source

fn encode<W: Write>(&self, output: &mut W) -> Result<()>

Source

fn decode<R: Read>(tag: u8, input: &mut R) -> Result<Self>

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§