aztec-nr - noir_aztec::macros::events

Function event

pub comptime fn event(s: TypeDefinition) -> Quoted

Generates the core event functionality for a struct, including the EventInterface implementation (which provides the event type id) and a Serialize implementation if one is not already provided.

Requirements

Events can be emitted both privately and publicly. Public emission imposes no requirements, but for an event to be emittable privately its serialization length must not exceeed MAX_EVENT_SERIALIZED_LEN.