# `KiwiCodec.RustlerGenerator.UnknownFields`
[🔗](https://github.com/open-pencil/kiwi_codec/blob/v0.7.0/codegen/kiwi_codec/rustler_generator/unknown_fields.ex#L2)

Selects how generated Rustler decoders handle message fields the compiled
schema does not define.

Every generated message decoder calls `kiwi_unknown_field(decoder, definition,
field)` for such a field and continues with the next one when it returns.

  * `:error` rejects the data with `Error::BadArg`.
  * `:runtime_schema` skips the field using a `KiwiRuntimeSchema` decoded from
    the schema that accompanies the data, which the `Decoder` returns from
    `runtime_schema()`; see `KiwiCodec.RustlerGenerator.Decoder`.

The runtime schema only skips values; decoded output is unchanged. Kiwi
struct layouts cannot be extended compatibly, so a schema that changes a
struct the compiled decoders read is not supported.

# `__mix_recompile__?`

Whether the module's Rust file appeared or went since the module compiled.

# `__rustq_asts__`

The RustQ AST of each `defrust` definition.

# `__rustq_callables__`

Callable metadata for the module's definitions.

# `__rustq_items__`

The Rust items the module generates, in order.

# `__rustq_macro_definitions__`

The module's `defrustmacro` definitions.

# `__rustq_macro_items__`

The `macro_rules!` items `defrustmacro` emits.

# `__rustq_rust_modules__`

The Rust modules the module's `defrustmod`s map its aliases, or itself (`[]`), to.

# `__rustq_source__`

The Rust source the module generates.

# `__rustq_type_asts__`

The RustQ AST of each declared Rust type.

# `__rustq_type_items__`

The Rust items the module's types generate.

# `__rustq_types__`

The Rust types the module's `@type`s declare.

# `fragments`

```elixir
@spec fragments(:error | :runtime_schema) :: [RustQ.Rust.Fragment.t()]
```

Returns the Rust items implementing `mode`.

# `kiwi_unknown_field`

```elixir
@spec kiwi_unknown_field(
  RustQ.Type.mut_ref(RustQ.Type.path(:Decoder, RustQ.Type.lifetime(:_))),
  RustQ.Type.str(),
  RustQ.Type.u32()
) :: RustQ.Type.nif_result(RustQ.Type.unit())
```

A Rust function `defrust` generates. It runs only as Rust; calling it from Elixir
raises.

---

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