Skip to main content

sim_citizen/
lib.rs

1//! Citizen support outside the SIM kernel.
2//!
3//! A citizen is a public SIM-facing runtime value with a class-backed read
4//! constructor, constructor encoding, conformance fixture, and census row.
5//! Domain values usually opt in with `#[derive(Citizen)]`; hard cases may
6//! register hand-written citizens, and live handles carry inline
7//! `#[non_citizen]` exemptions that name their descriptor strategy.
8//!
9//! This crate owns only the shared support layer: registry rows, runtime
10//! installation helpers, fixture checks, generated census rendering, and the
11//! semantic equality helpers used by the strict citizen gate. Read-construct
12//! remains capability-gated by the codec/runtime path, not by this crate.
13//!
14//! # Surface
15//!
16//! Conformance fixtures check a citizen's read-construct round trip; the field
17//! and equality traits encode citizen fields and back the strict semantic
18//! equality gate; the registry and runtime helpers install citizens into a
19//! library and a context; the card and census helpers render browse and census
20//! output; and a reference citizen value is provided as an example.
21
22#![forbid(unsafe_code)]
23#![deny(missing_docs)]
24
25extern crate self as sim_citizen;
26
27mod card;
28mod census;
29mod conformance;
30mod eq;
31mod field;
32mod registry;
33mod runtime;
34mod symbol;
35
36pub use card::citizen_card;
37pub use census::{citizen_census_markdown, render_citizen_census};
38pub use conformance::{
39    check_default_fixture, check_fixture, check_value_fixture,
40    check_value_fixture_with_wrong_version, run_registered_conformance,
41};
42pub use eq::{CitizenEq, expr_citizen_eq, values_citizen_eq};
43pub use field::{
44    CitizenField, arity_error, decode_version, field_error, value_from_expr, value_to_expr,
45};
46pub use registry::{
47    CitizenInfo, CitizenLib, InstallFn, install_all, install_namespace, registered_citizens,
48};
49pub use runtime::{Citizen, CitizenRuntime, constructor_expr, install_derived};
50pub use symbol::parse_symbol;
51
52pub use inventory;
53
54#[cfg(test)]
55mod example;
56
57#[cfg(test)]
58mod tests;