IntoDecodableValues

Trait IntoDecodableValues 

Source
pub trait IntoDecodableValues: Sized {
    type Values: DecodableValues<Target = Self>;

    // Required methods
    fn into_decodable_values() -> Self::Values;
    fn num_decodable_values() -> Option<usize>;
}
Expand description

This can be implemented for any type that can be decoded into in multiple steps via scale_decode::DecodeAsType. The common use case is to decode some sets of bytes into a tuple of multiple types, step by step. As well as tuples up to size 12, Implementations also exist and arrays.

Required Associated Types§

Source

type Values: DecodableValues<Target = Self>

The decoder we’ll use to iteratively decode bytes.

Required Methods§

Source

fn into_decodable_values() -> Self::Values

Construct a type that is ready to decode values and return the target type.

Source

fn num_decodable_values() -> Option<usize>

The exact number of values that should be provided to DecodableValues::decode_next_value() before DecodableValues::decoded_target() can be called. If this returns None then it indicates that any number of values can be decoded into Self.

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 IntoDecodableValues for ()

Source§

impl<A: DecodeAsType> IntoDecodableValues for (A,)

Source§

impl<A: DecodeAsType, B: DecodeAsType> IntoDecodableValues for (A, B)

Source§

impl<A: DecodeAsType, B: DecodeAsType, C: DecodeAsType> IntoDecodableValues for (A, B, C)

Source§

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

Source§

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

Source§

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

Source§

type Values = TupleIter<A, B, C, D, E, F>

Source§

fn into_decodable_values() -> Self::Values

Source§

fn num_decodable_values() -> Option<usize>

Source§

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

Source§

type Values = TupleIter<A, B, C, D, E, F, G>

Source§

fn into_decodable_values() -> Self::Values

Source§

fn num_decodable_values() -> Option<usize>

Source§

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

Source§

type Values = TupleIter<A, B, C, D, E, F, G, H>

Source§

fn into_decodable_values() -> Self::Values

Source§

fn num_decodable_values() -> Option<usize>

Source§

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

Source§

type Values = TupleIter<A, B, C, D, E, F, G, H, I>

Source§

fn into_decodable_values() -> Self::Values

Source§

fn num_decodable_values() -> Option<usize>

Source§

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

Source§

type Values = TupleIter<A, B, C, D, E, F, G, H, I, J>

Source§

fn into_decodable_values() -> Self::Values

Source§

fn num_decodable_values() -> Option<usize>

Source§

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

Source§

type Values = TupleIter<A, B, C, D, E, F, G, H, I, J, K>

Source§

fn into_decodable_values() -> Self::Values

Source§

fn num_decodable_values() -> Option<usize>

Source§

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

Source§

type Values = TupleIter<A, B, C, D, E, F, G, H, I, J, K, L>

Source§

fn into_decodable_values() -> Self::Values

Source§

fn num_decodable_values() -> Option<usize>

Source§

impl<T: DecodeAsType> IntoDecodableValues for Vec<T>

Source§

impl<const N: usize, T: DecodeAsType> IntoDecodableValues for [T; N]

Implementors§