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

# Function generate_public_dispatch

Module: `noir_aztec::macros::dispatch`

```rust
pub comptime fn generate_public_dispatch(
    m: Module,
    generate_emit_public_init_nullifier: bool,
) -> Quoted
```

Generates a `public_dispatch` function for an Aztec contract module `m`.

The generated function dispatches public calls based on selector to the appropriate contract function. If `generate_emit_public_init_nullifier` is true, it also handles dispatch to the macro-generated `__emit_public_init_nullifier` function.

Alongside `public_dispatch`, this also emits one `__aztec_nr_internals__unpack_arguments_<N>` helper per parameter-type signature shared by enough public functions; see \[compute_unpack_prelude] for the extraction criterion.
