Expand description
The Visitor trait and associated types.
Modules§
- types
- Types used in the
super::Visitortrait definition.
Structs§
- Ignore
Visitor - A
Visitorimplementation that just ignores all of the bytes. - Visitor
With Crate Error - Some
Visitorimplementations may want to return an error type other thancrate::Error, which means that they would not be automatically compatible withcrate::IntoVisitor, which requires visitors that do returncrate::Errorerrors.
Enums§
- Decode
AsType Result - The response from
Visitor::unchecked_decode_as_type(). - Decode
Error - An error decoding SCALE bytes.
- Unexpected
- This is returned by default when a visitor function isn’t implemented.
Traits§
- Decode
Item Iterator - This is implemented for visitor related types which have a
decode_itemmethod, and allows you to generically talk about decoding unnamed items. - Visitor
- An implementation of the
Visitortrait can be passed to thedecode_with_visitor()function, and is handed back values as they are encountered. It’s up to the implementation to decide what to do with these values.
Functions§
- decode_
with_ visitor - 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
Visitorwill be called depending on the type that needs to be decoded.