Trait Decodable

Source
pub trait Decodable: Sized {
    type DecoderArray: DecoderArray<Decode = Self>;

    // Required method
    fn decode(
        sticks: DynRootBranch<'_>,
        options: &impl DecodeOptions,
    ) -> Result<Self, DecodeError>;
}

Required Associated Types§

Source

type DecoderArray: DecoderArray<Decode = Self>

Required Methods§

Source

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

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 Decodable for bool

Source§

type DecoderArray = IntoIter<bool>

Source§

fn decode( sticks: DynRootBranch<'_>, _options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl Decodable for f32

Source§

type DecoderArray = IntoIter<f32>

Source§

fn decode( sticks: DynRootBranch<'_>, _options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl Decodable for f64

Source§

type DecoderArray = IntoIter<f64>

Source§

fn decode( sticks: DynRootBranch<'_>, _options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl Decodable for u8

Source§

type DecoderArray = IntoIter<u8>

Source§

fn decode( sticks: DynRootBranch<'_>, _options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl Decodable for u16

Source§

type DecoderArray = IntoIter<u16>

Source§

fn decode( sticks: DynRootBranch<'_>, _options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl Decodable for u32

Source§

type DecoderArray = IntoIter<u32>

Source§

fn decode( sticks: DynRootBranch<'_>, _options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl Decodable for u64

Source§

type DecoderArray = IntoIter<u64>

Source§

fn decode( sticks: DynRootBranch<'_>, _options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl Decodable for String

Source§

type DecoderArray = IntoIter<String>

Source§

fn decode( sticks: DynRootBranch<'_>, _options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<K: Decodable + Hash + Eq + Send, V: Decodable + Send, S: Default + BuildHasher> Decodable for HashMap<K, V, S>
where DecodeError: From<<<K as Decodable>::DecoderArray as DecoderArray>::Error> + From<<<V as Decodable>::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = Option<HashMapArrayDecoder<<K as Decodable>::DecoderArray, <V as Decodable>::DecoderArray, S>>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T0: Decodable + Send, T1: Decodable + Send> Decodable for (T0, T1)
where DecodeError: From<<T0::DecoderArray as DecoderArray>::Error> + From<<T1::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = (<T0 as Decodable>::DecoderArray, <T1 as Decodable>::DecoderArray)

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T0: Decodable + Send, T1: Decodable + Send, T2: Decodable + Send> Decodable for (T0, T1, T2)
where DecodeError: From<<T0::DecoderArray as DecoderArray>::Error> + From<<T1::DecoderArray as DecoderArray>::Error> + From<<T2::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = (<T0 as Decodable>::DecoderArray, <T1 as Decodable>::DecoderArray, <T2 as Decodable>::DecoderArray)

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T0: Decodable + Send, T1: Decodable + Send, T2: Decodable + Send, T3: Decodable + Send> Decodable for (T0, T1, T2, T3)
where DecodeError: From<<T0::DecoderArray as DecoderArray>::Error> + From<<T1::DecoderArray as DecoderArray>::Error> + From<<T2::DecoderArray as DecoderArray>::Error> + From<<T3::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = (<T0 as Decodable>::DecoderArray, <T1 as Decodable>::DecoderArray, <T2 as Decodable>::DecoderArray, <T3 as Decodable>::DecoderArray)

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T0: Decodable + Send, T1: Decodable + Send, T2: Decodable + Send, T3: Decodable + Send, T4: Decodable + Send> Decodable for (T0, T1, T2, T3, T4)
where DecodeError: From<<T0::DecoderArray as DecoderArray>::Error> + From<<T1::DecoderArray as DecoderArray>::Error> + From<<T2::DecoderArray as DecoderArray>::Error> + From<<T3::DecoderArray as DecoderArray>::Error> + From<<T4::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = (<T0 as Decodable>::DecoderArray, <T1 as Decodable>::DecoderArray, <T2 as Decodable>::DecoderArray, <T3 as Decodable>::DecoderArray, <T4 as Decodable>::DecoderArray)

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T0: Decodable + Send, T1: Decodable + Send, T2: Decodable + Send, T3: Decodable + Send, T4: Decodable + Send, T5: Decodable + Send> Decodable for (T0, T1, T2, T3, T4, T5)
where DecodeError: From<<T0::DecoderArray as DecoderArray>::Error> + From<<T1::DecoderArray as DecoderArray>::Error> + From<<T2::DecoderArray as DecoderArray>::Error> + From<<T3::DecoderArray as DecoderArray>::Error> + From<<T4::DecoderArray as DecoderArray>::Error> + From<<T5::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = (<T0 as Decodable>::DecoderArray, <T1 as Decodable>::DecoderArray, <T2 as Decodable>::DecoderArray, <T3 as Decodable>::DecoderArray, <T4 as Decodable>::DecoderArray, <T5 as Decodable>::DecoderArray)

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 2]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 3]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 4]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 5]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 6]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 7]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 8]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 9]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 10]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 11]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 12]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 13]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 14]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 15]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 16]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 17]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 18]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 19]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 20]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 32]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 64]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 128]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 256]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable + Sized> Decodable for [T; 512]
where DecodeError: From<<T::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = ArrayDecoder<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable> Decodable for Option<T>

Source§

type DecoderArray = Option<NullableDecoder<<T as Decodable>::DecoderArray>>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable> Decodable for Box<T>

Source§

type DecoderArray = BoxDecoderArray<<T as Decodable>::DecoderArray>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Source§

impl<T: Decodable> Decodable for Vec<T>
where DecodeError: From<<<T as Decodable>::DecoderArray as DecoderArray>::Error>,

Source§

type DecoderArray = Option<VecArrayDecoder<<T as Decodable>::DecoderArray>>

Source§

fn decode( sticks: DynRootBranch<'_>, options: &impl DecodeOptions, ) -> Result<Self, DecodeError>

Implementors§