# `RustQ.Rustler.Atom`
[🔗](https://github.com/dannote/rustq/blob/v0.11.1/lib/rustq/rustler/atom.ex#L1)

Generates Rustler atom declarations, decoders, dispatchers, and cached atom helpers.

Decoder and dispatch helpers prefer RustQ AST. Options such as `:on`, `:cases`,
and `:unknown` may accept explicit Rust expression strings for advanced caller
escape hatches; prefer AST expressions when composing generated code.

# `cached`

```elixir
@spec cached(
  [atom() | String.t() | {atom() | String.t(), String.t()}],
  keyword()
) :: [RustQ.Rust.AST.item()]
```

Builds `OnceLock<Atom>` declarations and cached atom accessors.

# `declaration`

```elixir
@spec declaration(
  [atom() | String.t() | {atom() | String.t(), String.t()}],
  keyword()
) :: RustQ.Rust.AST.MacroItemCall.t() | RustQ.Rust.AST.Module.t()
```

Builds a `rustler::atoms!` declaration, optionally wrapped in a module.

# `decoder`

```elixir
@spec decoder(
  atom() | String.t(),
  keyword()
) :: RustQ.Rust.AST.Function.t()
```

Builds a function that decodes Rustler atoms into Rust values.

# `dispatch`

```elixir
@spec dispatch(
  atom() | String.t(),
  keyword()
) :: RustQ.Rust.AST.Function.t()
```

Builds a function that dispatches an expression by atom value.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
