Expand description
Embedded admin templates for rustio-admin.
This crate is the single owner of the admin panel’s template bytes.
They are baked into the binary via include_str! at compile time —
single-binary deploy is a hard constraint of the framework.
Two crates consume this:
rustio-admin(the runtime) readsEMBEDDED_TEMPLATESto build its minijinja loader and to validate project overrides.rustio-admin-clireadsembedded_template_names/embedded_template_sourcefor therustio-admin overridecommand, which materialises a copy of a framework template on disk.
The crate is deliberately std-only and dependency-free. It carries a
low MSRV so the lightweight parts of the CLI can depend on it without
pulling in — or inheriting the Rust version of — the runtime stack
(sqlx, tokio, hyper). A disk-side override still wins at render
time; that lookup lives in the runtime, not here. This crate only
owns the defaults.
Constants§
- EMBEDDED_
TEMPLATES - 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. The runtime iterates this to build its loader and to validate project overrides;embedded_template_namesandembedded_template_sourceare the name/lookup views over it.
Functions§
- embedded_
template_ names - Every embedded template name, by canonical path (e.g.
"admin/list.html"). Order matchesEMBEDDED_TEMPLATESand is stable across builds sorustio-admin overrideenumerates copy candidates deterministically; 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.