BinaryDecode

Trait BinaryDecode 

Source
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§

Source

fn decode<R: Read>(decoder: &mut BinaryDecoder<R>) -> ChieResult<Self>

Decode from binary format

§Errors

Returns error if decoding fails

Provided Methods§

Source

fn decode_from_slice(bytes: &[u8]) -> ChieResult<Self>

Convenience method to decode from a byte slice

§Errors

Returns error if decoding fails

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.

Implementors§