Expand description
Shared expression evaluation logic for Code Mode.
This module provides core evaluation functions that are used by both
synchronous (PlanExecutor) and asynchronous (AsyncScope) executors.
By centralizing this logic, we avoid duplication and ensure consistent
behavior across execution modes.
§Design
The evaluation functions are generic over a VariableProvider trait,
allowing them to work with different variable storage mechanisms:
ⓘ
// Sync executor uses HashMap directly
let value = evaluate_expr(&expr, &sync_vars, &local_scope)?;
// Async executor uses the same functions
let value = evaluate_expr(&expr, &async_vars, &local_scope)?;Enums§
- Json
String Mode - Controls how non-primitive JSON values are rendered to string.
Traits§
- Variable
Provider - Trait for providing variable values during evaluation.
Functions§
- evaluate
- Evaluate an expression with just a variable map (no local scope). This is a convenience wrapper for the common case.
- evaluate_
array_ method_ with_ scope - Evaluate an array method with scope.
- evaluate_
binary_ op - Evaluate a binary operation.
- evaluate_
number_ method - Evaluate a number method.
- evaluate_
unary_ op - Evaluate a unary operation.
- evaluate_
with_ binding - Evaluate an expression with an extra variable binding. Creates a merged scope with the new binding and evaluates.
- evaluate_
with_ scope - Evaluate a
ValueExprwith access to global and local variables. - evaluate_
with_ two_ bindings - Evaluate an expression with two extra variable bindings. Used for reduce operations with accumulator and item variables.
- is_
nullish - Check if a JSON value is nullish (null or undefined).
- is_
truthy - Check if a JSON value is truthy (JavaScript semantics).
- json_
to_ string - Convert JSON value to string (JavaScript-compatible mode).
- json_
to_ string_ with_ mode - Convert JSON value to string with configurable object rendering.
- to_
number - Convert a JSON value to a number (JavaScript semantics).