Trait scale_decode::DecodeAsFields
source · pub trait DecodeAsFields: Sized {
// Required method
fn decode_as_fields<'info>(
input: &mut &[u8],
fields: &mut dyn FieldIter<'info>,
types: &'info PortableRegistry
) -> 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§
sourcefn decode_as_fields<'info>(
input: &mut &[u8],
fields: &mut dyn FieldIter<'info>,
types: &'info PortableRegistry
) -> Result<Self, Error>
fn decode_as_fields<'info>( input: &mut &[u8], fields: &mut dyn FieldIter<'info>, types: &'info PortableRegistry ) -> Result<Self, Error>
Given some bytes and some fields denoting their structure, attempt to decode.
Object Safety§
This trait is not object safe.