# `DocShell.Generate.Collection.Limits`
[🔗](https://github.com/futhr/doc_shell/blob/v2.0.0/lib/doc_shell/generate/collection/limits.ex#L1)

Finite admission budgets for loading existing collection artifacts.

Limits bound bytes before JSON decoding and bound JSON nesting before the
decoder allocates its tree. Counts cover manifested files, provenance records
and descriptors. These are import limits, not promises about VM memory usage
or the future site renderer's output limits. A caller may explicitly raise or
lower any positive limit; unlimited sentinel values are not accepted.

# `t`

```elixir
@type t() :: %{required(atom()) =&gt; pos_integer()}
```

Validated positive import budgets; byte totals include the manifest.

# `check`

```elixir
@spec check(t(), atom(), non_neg_integer()) :: :ok | {:error, term()}
```

Checks an observed resource amount against its configured maximum.

# `check_depth`

```elixir
@spec check_depth(binary(), t()) :: :ok | {:error, term()}
```

Checks JSON container nesting without allocating the decoded tree.

# `new`

```elixir
@spec new(keyword()) :: {:ok, t()} | {:error, term()}
```

Validates keyword overrides and fills in finite defaults.

---

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