pub trait BinaryDecode: Sized {
// Required method
fn decode<R: Read>(decoder: &mut BinaryDecoder<R>) -> ChieResult<Self>;
// Provided method
fn decode_from_slice(bytes: &[u8]) -> ChieResult<Self> { ... }
}Expand description
Trait for types that can be decoded from binary format
Required Methods§
Sourcefn decode<R: Read>(decoder: &mut BinaryDecoder<R>) -> ChieResult<Self>
fn decode<R: Read>(decoder: &mut BinaryDecoder<R>) -> ChieResult<Self>
Provided Methods§
Sourcefn decode_from_slice(bytes: &[u8]) -> ChieResult<Self>
fn decode_from_slice(bytes: &[u8]) -> ChieResult<Self>
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.