Expand description
Citizen support outside the SIM kernel.
A citizen is a public SIM-facing runtime value with a class-backed read
constructor, constructor encoding, conformance fixture, and census row.
Domain values usually opt in with #[derive(Citizen)]; hard cases may
register hand-written citizens, and live handles carry inline
#[non_citizen] exemptions that name their descriptor strategy.
This crate owns only the shared support layer: registry rows, runtime installation helpers, fixture checks, generated census rendering, and the semantic equality helpers used by the strict citizen gate. Read-construct remains capability-gated by the codec/runtime path, not by this crate.
§Surface
Conformance fixtures check a citizen’s read-construct round trip; the field and equality traits encode citizen fields and back the strict semantic equality gate; the registry and runtime helpers install citizens into a library and a context; the card and census helpers render browse and census output; and a reference citizen value is provided as an example.
Re-exports§
pub use inventory;
Structs§
- Citizen
Info - One inventory-registered citizen’s static registry row.
- Citizen
Lib - A kernel
Libthat loads registered citizens into a context.
Traits§
- Citizen
- Static citizen identity: the metadata
#[derive(Citizen)]supplies. - Citizen
Eq - Semantic equality between citizen field values for the strict gate.
- Citizen
Field - Encodes and decodes a Rust type as one citizen constructor field.
- Citizen
Runtime - A fully runnable citizen: identity plus kernel object and read-construct.
Functions§
- arity_
error - Builds the standard error for a wrong read-constructor argument count.
- check_
default_ fixture - Checks the citizen’s default
CitizenRuntime::examplefixture round trip. - check_
fixture - Checks one runtime fixture’s read-construct round trip and failure paths.
- check_
value_ fixture - Checks an already-built citizen
Value’s read-construct round trip. - check_
value_ fixture_ with_ wrong_ version - Asserts the full citizen read-construct contract for one value.
- citizen_
card - Builds the browse Card record (a
coretable) for one registered citizen. - citizen_
census_ markdown - Renders the full census of inventory-registered citizens as Markdown.
- constructor_
expr - Encodes a citizen value as its read-construct
Exprextension form. - decode_
version - Checks that a citizen’s version argument equals the
expectedversion. - expr_
citizen_ eq - Compares two
Exprs under citizen equality. - field_
error - Builds a
citizen field <field>: <message>evaluation error. - install_
all - Installs every registered citizen’s class into
linker. - install_
derived - Installs a derived citizen
Tas a class value inlinker. - install_
namespace - Installs only the registered citizens whose symbol is in
namespace. - parse_
symbol - Parses
namespace/nametext into a kernelSymbol. - registered_
citizens - Iterates every
CitizenInforegistered throughinventory. - render_
citizen_ census - Renders the supplied citizen rows as a generated Markdown census table.
- run_
registered_ conformance - Loads every registered citizen and runs each citizen’s conformance fixture.
- value_
from_ expr - Builds a runtime
Valuefrom anExprusingcx’s factory. - value_
to_ expr - Projects a runtime
Valueto anExpr, tagging errors withfield. - values_
citizen_ eq - Compares two citizen
Values for semantic equality.