[][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 the field::Attrs docs.
  • #[digest(...)]: (struct only) support for storing a computed Verihash digest inside of a struct containing message fields. The digest field MUST be the last in the message. For more information, see the digest::Attrs docs.

See tests/derive.rs for usage examples.