Skip to main content

phon_engine/
lib.rs

1//! The backend-blind baseline engine.
2//!
3//! Compact (schema-driven) encode/decode, compatibility planning that turns a
4//! `(writer schema, reader schema, descriptor)` triple into IR, and the
5//! interpreter that runs that IR. The interpreter always works, on every
6//! platform, including those where a JIT cannot run (`r[exec.interpreter-baseline]`).
7//! Like `phon-ir`, this crate is binding-free: it consumes descriptors and an
8//! IR and reaches for no reflection (`r[crates.engine-is-binding-free]`).
9//!
10//! Spec: `docs/content/spec.md` — "Compact mode", "Compatibility", "Decoding",
11//! "Decoding untrusted input", and `r[crates.concern-separation]`.
12
13// r[impl crates.concern-separation]
14// r[impl crates.engine-is-binding-free]
15pub mod compact;
16
17pub use compact::{CompactError, Registry};
18
19mod compat;
20
21pub mod plan;
22
23pub use plan::Plan;
24
25pub mod interp;
26
27pub use interp::run;
28
29pub mod typed;
30
31/// The hostile-input validation discipline every decode path enforces: length
32/// and dimension bounds, depth limits, tag/text checks, set/map uniqueness, and
33/// schema-bundle verification.
34///
35/// Spec: "Decoding untrusted input" (`r[validate.*]`).
36pub mod validate {}