# flare.qpack.static_table

> A module of flare_mlake's API.

QPACK static table (RFC 9204 Appendix A).

The table holds 99 entries (indices 0..98) covering the most
common HTTP/3 header field shapes (``:authority``, ``:method``,
``:path``, ``:scheme``, ``:status`` plus a curated set of
request/response headers with their canonical values). The table
is read-only at compile time; the encoder picks the lowest-index
match, and the decoder maps a static index back to the
``(name, value)`` pair via ``static_table_lookup``.

Sans-I/O: pure data + pure functions.

## Functions

### `static_name`

```mojo
def static_name(index: Int) -> StaticString
```

Name at ``index``; the caller has range-checked it. A comptime switch over the table, so no table is built per call.

### `static_value`

```mojo
def static_value(index: Int) -> StaticString
```

Value at ``index``; the caller has range-checked it.

### `static_table_lookup`

```mojo
def static_table_lookup(index: Int) -> HpackHeader
```

Return the ``(name, value)`` pair at ``index`` in the RFC 9204 Appendix A static table.

Raises ``Error`` on out-of-range indices; the QPACK decoder
surfaces this as a malformed-field-line failure.

### `static_table_find`

```mojo
def static_table_find(name: String, value: String) -> Int
```

Return the lowest static-table index for the ``(name, value)`` pair, or ``-1`` if none matches.

Unrolled at compile time against the literal table. Lookup is
case-sensitive on both fields -- callers normalise header names
to lowercase before consulting the table (HTTP/3 mandates
lowercase field names on the wire, RFC 9114 §4.2).

### `static_table_find_name`

```mojo
def static_table_find_name(name: String) -> Int
```

Return the lowest static-table index whose name is ``name``, independent of value. Used by the encoder when no full ``(name, value)`` match exists but the name itself is present in the static table (literal-with-name-reference path).

## Aliases

### `QPACK_STATIC_TABLE_SIZE`

```mojo
comptime QPACK_STATIC_TABLE_SIZE = Int(99)
```

Number of entries in the RFC 9204 Appendix A static table.

Lookups are comptime-unrolled over the literal table, so neither
side builds the table at run time.
