# `KiwiCodec.SchemaInterpreter.Prepared`
[🔗](https://github.com/open-pencil/kiwi_codec/blob/v0.7.0/lib/kiwi_codec/schema_interpreter/prepared.ex#L1)

Indexed Kiwi schema for repeated runtime interpretation.

Prepared schemas preserve the parsed schema definitions while adding constant-
time definition, message-field, and enum-variant lookup tables. Build one with
`KiwiCodec.SchemaInterpreter.prepare/1` and reuse it across encode/decode calls.

# `t`

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

# `definition`

```elixir
@spec definition(t(), String.t()) :: KiwiCodec.Schema.definition() | nil
```

Returns the definition named `name`, or `nil`.

# `enum_name`

```elixir
@spec enum_name(t(), String.t(), integer()) :: String.t() | nil
```

Returns the name of the enum `definition_name`'s variant with `value`, or `nil`.

# `enum_value`

```elixir
@spec enum_value(t(), String.t(), String.t()) :: integer() | nil
```

Returns the value of the enum `definition_name`'s variant `name`, or `nil`.

# `message_field`

```elixir
@spec message_field(t(), String.t(), pos_integer()) ::
  KiwiCodec.Schema.Field.t() | nil
```

Returns the field with tag `id` of the message `definition_name`, or `nil`.

# `new`

```elixir
@spec new(KiwiCodec.Schema.t()) :: t()
```

Indexes a schema's definitions, message fields, and enum values for decoding.

---

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