pub struct Evaluator { /* private fields */ }Expand description
Evaluator for JSONata expressions
Implementations§
Source§impl Evaluator
impl Evaluator
pub fn new() -> Self
pub fn with_context(context: Context) -> Self
Sourcepub fn with_options(context: Context, options: EvaluatorOptions) -> Self
pub fn with_options(context: Context, options: EvaluatorOptions) -> Self
Construct an Evaluator with guardrail options. Evaluator::new()/
with_context() remain unchanged (unlimited options) for existing callers.
Sourcepub fn evaluate(
&mut self,
node: &AstNode,
data: &JValue,
) -> Result<JValue, EvaluatorError>
pub fn evaluate( &mut self, node: &AstNode, data: &JValue, ) -> Result<JValue, EvaluatorError>
Evaluate an AST node against data
This is the main entry point for evaluation. It sets up the parent context to be the root data if not already set.
Also the single choke point for stripping any lingering tuple-stream
wrapper objects ({"@":.., "__tuple__":true, ...}) from the result before
it reaches the caller — %/@/# are implemented internally via a
tuple-stream representation (see create_tuple_stream), and without this
a bare (or object/array-nested) tuple-producing expression would leak
that internal representation into user-visible output instead of the
plain value.
Trait Implementations§
Auto Trait Implementations§
impl !Send for Evaluator
impl !Sync for Evaluator
impl Freeze for Evaluator
impl RefUnwindSafe for Evaluator
impl Unpin for Evaluator
impl UnsafeUnpin for Evaluator
impl UnwindSafe for Evaluator
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