Trait DecodeAsFields

Source
pub trait DecodeAsFields: Sized {
    // Required method
    fn decode_as_fields<'resolver, R: TypeResolver>(
        input: &mut &[u8],
        fields: &mut dyn FieldIter<'resolver, R::TypeId>,
        types: &'resolver R,
    ) -> Result<Self, Error>;
}
Expand description

This is similar to DecodeAsType, except that it’s instead implemented for types that can be given a list of fields denoting the type being decoded from and attempt to do this decoding. This is generally implemented just for tuple and struct types, and is automatically implemented via the DecodeAsType macro.

Required Methods§

Source

fn decode_as_fields<'resolver, R: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, R::TypeId>, types: &'resolver R, ) -> Result<Self, Error>

Given some bytes and some fields denoting their structure, attempt to decode.

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

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

impl<A> DecodeAsFields for (A,)
where A: IntoVisitor,

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

impl<A, B> DecodeAsFields for (A, B)
where A: IntoVisitor, B: IntoVisitor,

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

impl<A, B, C> DecodeAsFields for (A, B, C)

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

impl<A, B, C, D> DecodeAsFields for (A, B, C, D)

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

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

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

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

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

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

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

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

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

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

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

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

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

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

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

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

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

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

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N> DecodeAsFields for (A, B, C, D, E, F, G, H, I, J, K, L, M, N)

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> DecodeAsFields for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> DecodeAsFields for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q> DecodeAsFields for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R> DecodeAsFields for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S> DecodeAsFields for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Source§

impl<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T> DecodeAsFields for (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)

Source§

fn decode_as_fields<'resolver, Resolver: TypeResolver>( input: &mut &[u8], fields: &mut dyn FieldIter<'resolver, Resolver::TypeId>, types: &'resolver Resolver, ) -> Result<Self, Error>

Implementors§