pub trait Decode: Sized {
// Required method
fn decode_with_tag<R: Read>(
reader: &mut R,
tag: u8,
) -> Result<Self, DecodeError>;
// Provided method
fn decode<R: Read>(reader: &mut R) -> Result<Self, DecodeError> { ... }
}
Expand description
This trait allows decoding an object from a byte sequence.
Required Methods§
fn decode_with_tag<R: Read>( reader: &mut R, tag: u8, ) -> Result<Self, DecodeError>
Provided 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.