Decode

Trait Decode 

Source
pub trait Decode: Sized {
    type Error: Error;

    // Required method
    fn decode<R: Read>(r: &mut R) -> Result<Self, Self::Error>;
}
Expand description

A trait for decoding types from Essential Words in a manner compatible with Pint’s ABI.

Required Associated Types§

Source

type Error: Error

Any error that might occur during decoding.

Required Methods§

Source

fn decode<R: Read>(r: &mut R) -> Result<Self, Self::Error>

Decode an instance of Self from words read from the given reader.

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.

Implementations on Foreign Types§

Source§

impl Decode for bool

Source§

type Error = BoolError

Source§

fn decode<R: Read>(r: &mut R) -> Result<Self, Self::Error>

Source§

impl<A: Decode, B: Decode> Decode for (A, B)

Source§

type Error = PairError<<A as Decode>::Error, <B as Decode>::Error>

Source§

fn decode<R: Read>(r: &mut R) -> Result<Self, Self::Error>

Source§

impl<A: Decode, B: Decode, C: Decode> Decode for (A, B, C)

Source§

type Error = PairError<<A as Decode>::Error, <(B, C) as Decode>::Error>

Source§

fn decode<R: Read>(r: &mut R) -> Result<Self, Self::Error>

Source§

impl<A: Decode, B: Decode, C: Decode, D: Decode> Decode for (A, B, C, D)

Source§

type Error = PairError<<A as Decode>::Error, <(B, C, D) as Decode>::Error>

Source§

fn decode<R: Read>(r: &mut R) -> Result<Self, Self::Error>

Source§

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode> Decode for (A, B, C, D, E)

Source§

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode> Decode for (A, B, C, D, E, F)

Source§

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, G: Decode> Decode for (A, B, C, D, E, F, G)

Source§

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, G: Decode, H: Decode> Decode for (A, B, C, D, E, F, G, H)

Source§

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, G: Decode, H: Decode, I: Decode> Decode for (A, B, C, D, E, F, G, H, I)

Source§

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, G: Decode, H: Decode, I: Decode, J: Decode> Decode for (A, B, C, D, E, F, G, H, I, J)

Source§

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, G: Decode, H: Decode, I: Decode, J: Decode, K: Decode> Decode for (A, B, C, D, E, F, G, H, I, J, K)

Source§

impl<A: Decode, B: Decode, C: Decode, D: Decode, E: Decode, F: Decode, G: Decode, H: Decode, I: Decode, J: Decode, K: Decode, L: Decode> Decode for (A, B, C, D, E, F, G, H, I, J, K, L)

Source§

impl<T> Decode for Option<T>
where T: Decode,

Source§

type Error = PairError<<T as Decode>::Error, SizedError>

Source§

fn decode<R: Read>(r: &mut R) -> Result<Self, Self::Error>

Source§

impl<const N: usize, T> Decode for [T; N]
where T: Decode,

Source§

type Error = <T as Decode>::Error

Source§

fn decode<R: Read>(r: &mut R) -> Result<Self, Self::Error>

Implementors§