pub trait Encoder {
type Item<'a>;
type Error: From<Error>;
// Required method
fn encode(
&mut self,
item: Self::Item<'_>,
dst: &mut BytesMut,
) -> Result<(), Self::Error>;
}
Expand description
Encoding of messages as bytes, for use with FramedWrite
.
Required Associated Types§
Required Methods§
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.