Skip to main content

FormatDecoder

Trait FormatDecoder 

Source
pub trait FormatDecoder<V> {
    type DecodeError;

    // Required method
    fn decode(&mut self, reader: impl Read) -> Result<V, Self::DecodeError>;
}
Expand description

A trait for decoding values of type V from a specific format

Required Associated Types§

Source

type DecodeError

The error type that can occur during decoding

Required Methods§

Source

fn decode(&mut self, reader: impl Read) -> Result<V, Self::DecodeError>

Decodes a value from the provided reader

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T, V> FormatDecoder<V> for &mut T
where T: ?Sized + FormatDecoder<V>,

Source§

type DecodeError = <T as FormatDecoder<V>>::DecodeError

Source§

fn decode(&mut self, reader: impl Read) -> Result<V, Self::DecodeError>

Source§

impl<T, V> FormatDecoder<V> for Box<T>
where T: ?Sized + FormatDecoder<V>,

Source§

type DecodeError = <T as FormatDecoder<V>>::DecodeError

Source§

fn decode(&mut self, reader: impl Read) -> Result<V, Self::DecodeError>

Implementors§