Crate strict_encoding_derive
source ·Expand description
Derivation macros for strict encoding. To learn more about the strict
encoding please check strict_encoding
crate.
§Derivation macros
Library exports derivation macros #[derive(
StrictEncode
)]
,
#[derive(
StrictDecode
)]
, which can be added on top of any structure
you’d like to support string encoding (see Example section below).
Encoding/decoding implemented by both of these macros may be configured at
type and individual field level using #[strict_type(...)]
attributes.
§Attribute
StrictEncode
and StrictDecode
behavior can be customized with
#[strict_encoding(...)]
attribute, which accepts different arguments
depending to which part of the data type it is applied.
§Attribute arguments at type declaration level
Derivation macros accept #[strict_encoding()]
attribute with the following
arguments:
Derive Macros§
- Derives
StrictDecode
implementation for the type. - Derives
StrictDumb
implementation for the type. - Derives
StrictEncode
implementation for the type. - Derives
StrictType
implementation for the type.