Expand description
Template rendering. Rust code passes typed context; this module owns everything about HTML generation.
§Loader contract
Per-request lookup via minijinja::Environment::set_loader. On
every render call the cache is cleared, forcing the loader closure
to re-resolve from disk so a developer can edit a template under
RUSTIO_TEMPLATE_DIR and see the change on the next request without
restarting the process.
Lookup order, by template name <path>:
<RUSTIO_TEMPLATE_DIR>/<path>— project disk override.- Embedded default — compiled into the binary via
include_str!.
Per-model lookup hook: callers that pass a model context can use
Templates::render_for_model to add a third tier:
<RUSTIO_TEMPLATE_DIR>/admin/<model>/<page>.html<RUSTIO_TEMPLATE_DIR>/<path>- Embedded default
Structs§
Functions§
- embedded_
template_ names - Every template baked into the framework binary, by canonical name
(e.g.
"admin/list.html"). Order is stable across builds so a CLI verb that lists them produces deterministic output. Used byrustio-admin overrideto enumerate copy candidates; project code can also iterate this to build documentation pages. - embedded_
template_ source - Return the byte-for-byte source of an embedded template by name,
or
Nonewhen no such template exists. Used byrustio-admin overrideto materialise a copy at<RUSTIO_TEMPLATE_DIR>/<name>so the operator can start editing without first having to find the framework source.