Skip to main content

fsm_guards/engine/
mod.rs

1pub mod eval;
2
3use crate::ctx::EvalCtx;
4use crate::error::ApplyError;
5use serde_json::Value;
6
7/// Evaluate a JSONLogic rule against a data value.
8///
9/// No fuel limit. No custom operators. Returns the raw JSONLogic result value.
10///
11/// Use [`evaluate`](crate::evaluate) for FSM guard positions — it adds fuel
12/// metering, typed errors, and custom operator support.
13pub fn apply(rule: &Value, data: &Value) -> Result<Value, ApplyError> {
14    let ctx = EvalCtx::new();
15    let mut fuel = usize::MAX;
16    eval::apply_value(rule, data, &ctx, &mut fuel)
17}