# `RustQ.Generated`
[🔗](https://github.com/dannote/rustq/blob/v0.11.1/lib/rustq/generated.ex#L1)

File sync helpers for RustQ-generated sources.

Most projects should use `rustq.exs` with `mix rustq.gen`. Use this module
directly when a project already has its own Mix task and only needs RustQ's
write/check behavior.

    RustQ.Generated.sync!(:helpers,
      path: "native/my_nif/src/generated_helpers.rs",
      build: fn -> render_helpers() end
    )

Pass `check: true` to compare without writing, which is useful in CI.

# `target`

```elixir
@type target() :: {atom() | String.t(), keyword()}
```

# `check!`

```elixir
@spec check!(Path.t(), iodata(), keyword()) :: :ok
```

Raises `StaleError` when a generated file differs from expected content.

# `load_manifest!`

```elixir
@spec load_manifest!(Path.t()) :: [target()]
```

Loads and normalizes generated targets from a RustQ manifest.

# `sync!`

```elixir
@spec sync!(atom() | String.t(), keyword(), keyword()) :: :ok
```

Writes or checks one named generated target.

# `sync_all!`

```elixir
@spec sync_all!(
  [target()],
  keyword()
) :: :ok
```

Writes or checks all selected generated targets.

# `write!`

```elixir
@spec write!(Path.t(), iodata()) :: :ok
```

Writes normalized generated content, creating parent directories.

---

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