Trait Codec
pub trait Codec: Sized {
// Required methods
fn decode<B>(buf: &mut B) -> Result<Self, UnexpectedEnd>
where B: Buf;
fn encode<B>(&self, buf: &mut B)
where B: BufMut;
}Available on crate feature
quic only.Expand description
Infallible encoding and decoding of QUIC primitives
Required Methods§
fn decode<B>(buf: &mut B) -> Result<Self, UnexpectedEnd>where
B: Buf,
fn decode<B>(buf: &mut B) -> Result<Self, UnexpectedEnd>where
B: Buf,
Decode a Self from the provided buffer, if the buffer is large enough
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".