Skip to main content

varar_core/
lib.rs

1//! `varar-core` — the pure functional core of var, ported from the Java module
2//! `dev.varar.core`: parse → match → plan → execute, diffs, drift/hash,
3//! canonical JSON, and the conformance projections. No filesystem, network,
4//! time, or test-framework dependencies.
5//!
6//! The sealed Java interfaces (`Block`, `TableOrFence`, `ResolvedSteps`) become
7//! Rust enums; the exception hierarchy becomes [`error::StepError`]/`Result`;
8//! `Object` duck-typing becomes [`value::Value`]; reflective handler invocation
9//! becomes boxed closures ([`handler::Handler`]).
10
11#![forbid(unsafe_code)]
12// `StepFailure` carries the full diff payload the tests consume by value
13// (`run().unwrap_err().error`); boxing it would change that public surface.
14#![allow(clippy::result_large_err)]
15// Nested `if`/`if let` blocks mirror the Java control flow faithfully; stable
16// Rust has no `let`-chains to collapse the `if let` cases into.
17#![allow(clippy::collapsible_if)]
18// Declared exception to "no globals in the core": `execute::install_hook`
19// registers a Once-guarded, thread-local-gated process panic hook — the only
20// way to silence stderr for the panics `catch_unwind` deliberately catches
21// (the AssertionError parity channel). See its doc comment for the guarantees.
22
23pub mod ast;
24pub mod cell_diff;
25pub mod conformance;
26pub mod diagnostics;
27pub mod doc_string_diff;
28pub mod drift;
29pub mod error;
30pub mod execute;
31pub mod expression;
32pub mod failure;
33mod failure_anchor;
34pub mod handler;
35pub mod hash;
36pub mod json_escape;
37pub mod json_value;
38pub mod matcher;
39pub mod offsets;
40pub mod param_diff;
41pub mod parse;
42pub mod plan;
43pub mod reference;
44pub mod registry;
45pub mod result;
46pub mod scanner;
47pub mod sentences;
48pub mod span;
49pub mod step_kind;
50pub mod step_role;
51pub mod structurer;
52pub mod table_cells;
53pub mod value;