Trait Decode

Source
pub trait Decode<D: Decoder>
where Self: Sized,
{ // Required method fn decode_data(decoder: &mut D) -> Result<Self, D::Error>; }
Expand description

Decode trait for versioned data, it is used in combination with the Decoder trait.

Many decoders will provide a blanket implementation for this trait.

Required Methods§

Source

fn decode_data(decoder: &mut D) -> Result<Self, D::Error>

Decode the data from the decoder.

§Errors

This function will return an error if the data cannot be decoded.

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§

Source§

impl<R, T> Decode<Decoder<R>> for T
where T: Decode<()>, R: Read,