# `Quic.LocalCIDs`
[🔗](https://github.com/gsmlg-dev/http_fetch/blob/v1.0.0-rc.9/apps/elixir_quic/lib/quic/local_cids.ex#L1)

Bounded local connection-ID issuance, registration, and retirement.

The caller supplies CID material and a registration identity scoped to its
connection generation. Registration acknowledgment makes an issuance ready;
only publication after a successful local send advances the sent watermark.
Retired entries are removed rather than retained as connection history.

# `entry`

```elixir
@type entry() :: %{cid: binary(), token: binary() | nil}
```

# `frame`

```elixir
@type frame() :: %{
  type: :new_connection_id,
  sequence: non_neg_integer(),
  retire_prior_to: 0,
  cid: binary(),
  token: binary()
}
```

# `pending`

```elixir
@type pending() :: %{
  sequence: non_neg_integer(),
  cid: binary(),
  token: binary(),
  registration_id: term(),
  status: :registering | :ready
}
```

# `registration`

```elixir
@type registration() :: %{
  sequence: non_neg_integer(),
  cid: binary(),
  token: binary(),
  registration_id: term()
}
```

# `t`

```elixir
@opaque t()
```

# `active?`

```elixir
@spec active?(t(), binary()) :: boolean()
```

# `configure`

```elixir
@spec configure(t(), integer()) :: {:ok, t()} | {:error, atom()}
```

# `new`

```elixir
@spec new(binary(), integer()) :: {:ok, t()} | {:error, atom()}
```

# `published`

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

Commit first transmission after successful registration and local send.

# `refill?`

```elixir
@spec refill?(t()) :: boolean()
```

Whether one refill can be reserved without duplicating pending work.

# `registered`

```elixir
@spec registered(t(), term()) :: {:ok, t(), frame()} | {:error, :stale_registration}
```

Acknowledge the exact route registration and return its ready frame.

# `reserve`

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

Reserve one route registration; this does not authorize advertisement.

# `retire`

```elixir
@spec retire(t(), non_neg_integer(), binary()) ::
  {:ok, t(), binary() | nil} | {:error, :invalid_connection_id_retirement}
```

Retire once, returning the route to remove without retaining its token.

---

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