pub struct Engine;Expand description
The core evaluation engine for JSONLogic expressions with fake data support.
Engine provides static methods for evaluating JSONLogic expressions,
processing schemas, and generating variables. It uses thread-local
DataLogic instances for safe concurrent usage.
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn evaluate(
expression: &Value,
context: &GenerationContext,
) -> Result<Value>
pub fn evaluate( expression: &Value, context: &GenerationContext, ) -> Result<Value>
Evaluates a single JSONLogic expression with the given context.
This method compiles and evaluates the expression using datalogic-rs,
with the custom fake operator available for generating fake data.
Sourcepub fn process_schema(
schema: &Value,
context: &GenerationContext,
) -> Result<Value>
pub fn process_schema( schema: &Value, context: &GenerationContext, ) -> Result<Value>
Processes a schema, evaluating all JSONLogic expressions within it.
This method recursively walks the schema structure, evaluating JSONLogic operators and preserving the overall structure of objects and arrays.
Auto Trait Implementations§
impl Freeze for Engine
impl RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
impl UnwindSafe for Engine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more