Expand description
Formspec Definition Evaluator — 4-phase batch processor.
§Layout
The main path is pipeline::evaluate_definition_full_with_instances_and_context:
rebuild— definition → item tree, initial values, repeat expansion, wildcard bindsrecalculate— relevance, required, readonly, variables, calculate (recalculate())revalidate— required/type/constraint, extensions, shapes (revalidate())nrb— output shaping for non-relevant fields
Cross-cutting: convert (path resolution), private fel_json (money-aware JSON→FelValue for env fields),
private runtime_seed (prePopulate / previous non-relevant). screener evaluates routes in an isolated env.
§Documentation
- Human overview: crate
README.md(phases, API map, context). - API reference:
cargo doc -p formspec-eval --no-deps --open. - Markdown API export:
docs/rustdoc-md/API.md(regenerate withnpm run docs:formspec-eval).
Re-exports§
pub use convert::resolve_value_by_path;pub use nrb::apply_nrb;pub use nrb::resolve_nrb;pub use rebuild::parse_variables;pub use rebuild::expand_repeat_instances;pub use rebuild::expand_wildcard_path;pub use rebuild::rebuild_item_tree;pub use recalculate::recalculate;pub use recalculate::topo_sort_variables;pub use revalidate::revalidate;pub use screener::ScreenerRouteResult;pub use screener::evaluate_screener;pub use types::EvalContext;pub use types::EvalTrigger;pub use types::EvaluationResult;pub use types::ExtensionConstraint;pub use types::ItemInfo;pub use types::NrbMode;pub use types::ValidationResult;pub use types::VariableDef;pub use types::WhitespaceMode;
Modules§
- convert
- Value resolution helpers for dotted paths and nested objects.
- nrb
- Phase 4: NRB (Non-Relevant Behavior) application.
- rebuild
- Phase 1: Rebuild — build the item tree from a definition JSON.
- recalculate
- Phase 2: Recalculate — evaluate computed values and bind expressions.
- revalidate
- Phase 3: Revalidate — validate all constraints and shapes.
- screener
- Screener evaluation — evaluate screener routes and return the first matching route.
- types
- Core types for the Formspec evaluator.
Structs§
- Eval
Host Context Bundle - Parsed WASM / JSON evaluation context bundle.
Functions§
- eval_
context_ from_ json_ object - Parses
EvalContextfields from a host JSON object (clock, prior validations,repeatCounts, …). - eval_
host_ context_ from_ json_ map - Parse the optional JSON context object passed to
evaluateDefinitionfrom JavaScript. - evaluate_
definition - Produce the final evaluation result. Evaluate a definition with the default continuous trigger.
- evaluate_
definition_ full - Evaluate a definition with trigger mode and extension constraints from registries.
- evaluate_
definition_ full_ with_ context - Evaluate a definition with trigger mode, extension constraints, and runtime context.
- evaluate_
definition_ full_ with_ instances - Evaluate a definition with trigger mode, extension constraints, and named instances.
- evaluate_
definition_ full_ with_ instances_ and_ context - Evaluate a definition with trigger mode, extension constraints, named instances, and runtime context.
- evaluate_
definition_ with_ context - Evaluate a definition with an explicit runtime context.
- evaluate_
definition_ with_ trigger - Evaluate a definition with an explicit trigger mode for shape timing.
- evaluate_
definition_ with_ trigger_ and_ context - Evaluate a definition with explicit trigger mode and runtime context.
- evaluation_
result_ to_ json_ value - Full batch evaluation output as JSON (matches
evaluateDefinitionWASM shape, camelCase). - evaluation_
result_ to_ json_ value_ styled - Serialize
EvaluationResultfor host bindings (JsCamelvsPythonSnakekeys). - extension_
constraints_ from_ registry_ documents - Extract extension constraint payloads from raw registry documents (
entriesarrays). - screener_
route_ to_ json_ value - Serialize a screener route for
evaluateScreener(nullwhen no match).