Derive Macros

  • The DecodeAsType derive macro can be used to implement DecodeAsType on structs and enums whose fields all implement DecodeAsType. Under the hood, the macro generates scale_decode::visitor::Visitor and scale_decode::IntoVisitor implementations for each type (as well as an associated Visitor struct), which in turn means that the type will automatically implement scale_decode::DecodeAsType.