# `ExMujoco.Gen.Template`
[🔗](https://github.com/d-led/ex.mujoco/blob/main/lib/ex_mujoco/gen/template.ex#L1)

The text this package generates, from the shapes `ExMujoco.Gen` hands it.

Kept apart from the reading and the deciding so that what a generated binding
looks like can be read in one place. Every emitted body is small on purpose: a
field is one `return` and one `FINE_NIF`, a function is one call, and the only
arithmetic anywhere is a dimension.

`c_src/ex_mujoco_nif.cpp` is *not* generated. The parts that need a decision
per call — an error buffer, an output array, a state signature — are written
out by hand and listed in `c_src/manifest.exs`.

# `api`

`ExMujoco.Api` — the C functions bound 1:1, under their C names.

# `coverage`

What is bound, what is not, and why — as Markdown.

# `enum_modules`

One module per enum, under `ExMujoco.Types`.

# `expressible?`

Whether a C function can be bound from its signature alone.

The rules are the four questions a NIF has to answer: what to pass for a
callback (nothing), what a `void*` is (anything), how long an output array is
(the caller's business), and what a variadic list contains (unknown).

# `field_nifs`

The field accessors, as NIFs.

# `fields`

`ExMujoco.Model` or `ExMujoco.Data` — a typed reader per field.

# `function_nifs`

The bound functions, as C++ NIFs.

# `native`

`ExMujoco.Native` — one stub per generated NIF, and the load hook.

# `unexpressible_reason`

Why a function cannot be bound, in a sentence.

---

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