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

Connection-owned QUIC stream state.

Stream values are data references; this module creates no processes. All
peer-controlled offsets and buffering are checked against the configured
limits before bytes are retained.

# `initial_state`

```elixir
@type initial_state() :: %Quic.Streams{
  blocked: MapSet.t(),
  data_consumed: 0,
  data_delivered: 0,
  data_received: 0,
  data_sent: 0,
  delivery: :immediate | :manual,
  max_buffer: term(),
  max_data: term(),
  max_local_stream_records: number(),
  max_peer_stream_records: number(),
  max_ready_bytes: term(),
  max_recv_ranges: term(),
  max_stream_data: term(),
  max_stream_data_bidi_local: term(),
  max_stream_data_bidi_remote: term(),
  max_stream_data_uni: term(),
  max_stream_records: number(),
  max_streams_bidi: number(),
  max_streams_uni: number(),
  next_local_bidi: 0,
  next_local_uni: 0,
  peer_max_data: term(),
  peer_max_stream_data: term(),
  peer_max_stream_data_bidi_local: term(),
  peer_max_stream_data_bidi_remote: term(),
  peer_max_stream_data_uni: term(),
  peer_max_streams_bidi: term(),
  peer_max_streams_uni: term(),
  pending_credit: %{},
  ready: %{},
  ready_bytes: 0,
  role: :client | :server,
  streams: %{}
}
```

# `t`

```elixir
@type t() :: %Quic.Streams{
  blocked: MapSet.t(),
  data_consumed: term(),
  data_delivered: term(),
  data_received: term(),
  data_sent: term(),
  delivery: term(),
  max_buffer: term(),
  max_data: term(),
  max_local_stream_records: term(),
  max_peer_stream_records: term(),
  max_ready_bytes: term(),
  max_recv_ranges: term(),
  max_stream_data: term(),
  max_stream_data_bidi_local: term(),
  max_stream_data_bidi_remote: term(),
  max_stream_data_uni: term(),
  max_stream_records: term(),
  max_streams_bidi: term(),
  max_streams_uni: term(),
  next_local_bidi: term(),
  next_local_uni: term(),
  peer_max_data: term(),
  peer_max_stream_data: term(),
  peer_max_stream_data_bidi_local: term(),
  peer_max_stream_data_bidi_remote: term(),
  peer_max_stream_data_uni: term(),
  peer_max_streams_bidi: term(),
  peer_max_streams_uni: term(),
  pending_credit: term(),
  ready: term(),
  ready_bytes: term(),
  role: term(),
  streams: term()
}
```

# `consume`

Consume queued stream events when `delivery: :manual` is configured.

# `install_peer_parameters`

Install authenticated peer transport parameters into stream send limits.

# `new`

```elixir
@spec new(:client | :server, keyword()) :: initial_state()
```

# `open`

Open a locally initiated stream and return its stable stream id.

# `peer_stop_sending`

Apply a peer STOP_SENDING to the local send direction.

# `receive`

Process one authenticated STREAM frame and emit newly contiguous bytes.

# `receive_reset`

Apply a peer RESET_STREAM, admitting a previously unseen peer stream.

# `reset`

# `reset_send`

Reset the local send direction at its admitted final size.

# `send`

Admit bytes to a stream send queue; returned frame can be packetized.

# `stop_sending`

# `stream`

# `take_credit`

Return coalesced receive-credit frames and clear their pending state.

# `update_credit`

---

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