Skip to main content

Crate seuil

Crate seuil 

Source
Expand description

§seuil-rs

A complete, safe, elite-tested JSONata implementation in Rust.

Seuil is French for “threshold” – the gateway between raw JSON data and the structured output your application needs.

§Quick Start

use seuil::Seuil;

let expr = Seuil::compile("name").unwrap();
let result = expr.evaluate(&serde_json::json!({"name": "Alice"})).unwrap();
assert_eq!(result, serde_json::json!("Alice"));

§Deterministic Simulation Testing

All non-determinism (time, randomness) is injectable via the clock::Environment trait:

use seuil::clock::MockEnvironment;
use seuil::EvalConfig;

let env = MockEnvironment::new(0xDEAD_BEEF);
let config = EvalConfig::with_environment(&env);
// All $now(), $millis(), $random(), $uuid() calls are now deterministic.

Re-exports§

pub use errors::Error;
pub use errors::Span;

Modules§

clock
Injectable environment for deterministic simulation testing.
datetime
DateTime picture string formatting and parsing for JSONata.
errors
Error types for seuil-rs.
evaluator
Expression evaluator.
parser
JSONata expression parser.

Structs§

EvalConfig
Configuration for expression evaluation.
Seuil
A compiled JSONata expression, ready for repeated evaluation.

Type Aliases§

Result
Result type for seuil operations.