sim-citizen
sim-citizen is the Rust support layer for SIM citizen values: domain objects
that have a public class symbol, read-constructor shape, conformance fixture,
semantic equality check, browse card, and census row.
Install
Most Rust domain types pair this crate with sim-citizen-derive:
What It Provides
CitizenandCitizenRuntimedescribe the class symbol, version, fields, constructor encoding, fixture, and runtime object hooks for a domain type.CitizenLibinstalls inventory-registered citizens into asim_kernel::Cx, whileCitizenRegistrylets a crate register named citizen types explicitly for release, LTO, and wasm checks.run_registered_conformanceexecutes inventory fixtures through the read-construct round-trip gate; the expected-symbol and explicit-registry variants fail closed when a required citizen row is absent.CitizenFieldencodes and decodes supported scalar, list, option, and custom field values.citizen_card,citizen_census_markdown, andcitizen_registry_census_markdownexpose the registry rows that a host or reviewer can inspect.
Contract Shape
A citizen publishes a namespace/Name class symbol, a numeric version, and a
fixed field order. Constructor encoding writes a tagged SIM expression with a
version argument followed by the field values. Decoding checks arity, version,
field domains, and semantic equality. Read-construction remains gated by the
runtime and codec path; this crate supplies the contract support, not ambient
construction permission.
Quick Use
use ;
use ;
use Arc;
The repository root README explains the crate group. The
recipes/citizen-roundtrip recipe shows a complete derived citizen that
registers explicitly, runs conformance, and prints its census row. API
documentation is on docs.rs under sim-citizen.