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§
fn encode<T: Serialize>(msg: &T) -> Result<Self::Buf>
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.