Skip to main content

evaluate_with_scope

Function evaluate_with_scope 

Source
pub fn evaluate_with_scope<V: VariableProvider>(
    expr: &ValueExpr,
    global_vars: &V,
    local_vars: &HashMap<String, Value>,
) -> Result<Value, ExecutionError>
Expand description

Evaluate a ValueExpr with access to global and local variables.

This is the core evaluation function used by both sync and async executors. It recursively evaluates expressions, properly handling scope for nested callbacks and block expressions.

§Arguments

  • expr - The expression to evaluate
  • global_vars - Global variable storage (executor’s variables)
  • local_vars - Local scope variables (callback parameters, block bindings)

§Returns

The evaluated JSON value or an execution error.