pub trait Codec: Sized {
// Required methods
fn encode<W: Write>(&self, w: W) -> Result<usize, Error>;
fn decode<R: Read>(r: R) -> Result<Self, Error>;
}Required Methods§
fn encode<W: Write>(&self, w: W) -> Result<usize, Error>
fn decode<R: Read>(r: R) -> Result<Self, Error>
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.