# `LlmCall.StreamState`
[🔗](https://github.com/gilbertwong96/llm_call/blob/main/lib/llm_call/stream_state.ex#L1)

Opaque per-codec streaming state.

The public API checks `codec/1` before delegating, so a state produced by one
codec cannot be fed to another. Codecs read their private data with `data/1`
and build a new state with `new/2`.

# `t`

```elixir
@type t() :: %LlmCall.StreamState{codec: module(), data: term()}
```

A codec's stream state, tagged with the codec that owns it.

This is a public struct type rather than `@opaque`: the behaviour hands the
struct to a codec in another module, and an opaque type cannot be destructured
across that boundary (Dialyzer rejects it). It is still a typed struct, never a
bare `term()`; `data` remains deliberately untyped.

# `codec`

```elixir
@spec codec(t()) :: module()
```

# `data`

```elixir
@spec data(t()) :: term()
```

# `new`

```elixir
@spec new(module(), term()) :: t()
```

---

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