pub trait DeserializeFromSlice: Sized {
    // Required method
    fn deserialize_from_slice(
        codec: &mut Codec<&[u8]>
    ) -> Result<Self, ReadError>;

    // Provided method
    fn deserialize_validate_from_slice(
        codec: &mut Codec<&[u8]>
    ) -> Result<(), ReadError> { ... }
}
Expand description

Define that an object can be read from a byte slice. This trait is implemented for all Deserialize implementors by default. The default implementation can be overridden if the user is sure they can benefit from slice-specific functions of Codec.

Required Methods§

source

fn deserialize_from_slice(codec: &mut Codec<&[u8]>) -> Result<Self, ReadError>

Provided Methods§

Implementors§