> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Function event

Module: `noir_aztec::macros::events`

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

Generates the core event functionality for a struct, including the [`EventInterface`](/aztec-nr-api/v6.0.0/noir_aztec/event/event_interface/trait.EventInterface.md) implementation (which provides the event type id) and a [`Serialize`](/aztec-nr-api/v6.0.0/serde/serialization/trait.Serialize.md) 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`](/aztec-nr-api/v6.0.0/noir_aztec/messages/logs/event/global.MAX_EVENT_SERIALIZED_LEN.md).
