decode_with_visitor

Function decode_with_visitor 

Source
pub fn decode_with_visitor<'scale, 'resolver, V>(
    data: &mut &'scale [u8],
    ty_id: <<V as Visitor>::TypeResolver as TypeResolver>::TypeId,
    types: &'resolver <V as Visitor>::TypeResolver,
    visitor: V,
) -> Result<<V as Visitor>::Value<'scale, 'resolver>, <V as Visitor>::Error>
where V: Visitor,
Expand description

An alias to scale_decode::visitor::decode_with_visitor. This can be used to decode the byte ranges given back from functions like crate::extrinsics::decode_extrinsic_current or crate::storage::decode_storage_key_current.

Decode data according to the type ID and type resolver provided. The provided pointer to the data slice will be moved forwards as needed depending on what was decoded, and a method on the provided Visitor will be called depending on the type that needs to be decoded.