pub trait CodecFor<T>: Codec {
type Decoded<'buf>: 'buf
where T: 'buf;
// Required methods
fn encode(msg: &T, buf: &mut [u8]) -> Result<usize, Self::Error>;
fn decode<'buf>(buf: &'buf [u8]) -> Result<Self::Decoded<'buf>, Self::Error>
where T: 'buf;
}Required Associated Types§
Required Methods§
fn encode(msg: &T, buf: &mut [u8]) -> Result<usize, Self::Error>
fn decode<'buf>(buf: &'buf [u8]) -> Result<Self::Decoded<'buf>, Self::Error>where
T: 'buf,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".