Derive Macro SizedEncode

Source
#[derive(SizedEncode)]
Available on crate feature proc-macro only.
Expand description

Implements Encode using the default implementation.

For simple structures, the value of MAX_ENCODED_SIZE is set as the combined value of Tn::MAX_ENCODED_SIZE wherein Tn is the type of each field.

For enumerations, the value is set such that each variant is treated like a structure (with the discriminant as an extra field) and where the variant that produces the largest MAX_ENCODED_SIZE is chosen.

As untagged unions cannot derive Encode, SizedEncode also cannot be derived for them.

Do remember that deriving this trait is only recommended