[−][src]Derive Macro veriform_derive::Message
#[derive(Message)] { // Attributes available to this derive: #[digest] #[field] }
Derive the Message
trait for an enum
or struct
.
When using this macro, every field in a struct
or every variant of an
enum
must have one of the following attributes:
#[field(...)]
: schema information for a field in a Veriform message. For more information on the syntax, see thefield::Attrs
docs.#[digest(...)]
: (struct
only) support for storing a computed Verihash digest inside of astruct
containing message fields. Thedigest
field MUST be the last in the message. For more information, see thedigest::Attrs
docs.
See tests/derive.rs
for usage examples.