pub struct Context<'a> {
pub expression: &'a str,
pub runtime: &'a Runtime,
pub offset: usize,
/* private fields */
}Expand description
Context object used during expression evaluation.
The Context struct carries state needed by the interpreter and functions, including the expression string (for error messages), runtime (for function lookup), current AST offset, and expref side-channel table.
Fields§
§expression: &'a strExpression string being interpreted.
runtime: &'a RuntimeJMESPath runtime used for function lookup.
offset: usizeCurrent AST offset (for error reporting).
Implementations§
Source§impl<'a> Context<'a>
impl<'a> Context<'a>
Sourcepub fn get_expref(&self, id: usize) -> Option<&Ast>
pub fn get_expref(&self, id: usize) -> Option<&Ast>
Retrieves an expref AST by index.
Sourcepub fn push_scope(&mut self, bindings: HashMap<String, Value>)
pub fn push_scope(&mut self, bindings: HashMap<String, Value>)
Push a new scope onto the scope stack.
Sourcepub fn get_variable(&self, name: &str) -> Option<Value>
pub fn get_variable(&self, name: &str) -> Option<Value>
Look up a variable in the scope stack.
Auto Trait Implementations§
impl<'a> Freeze for Context<'a>
impl<'a> !RefUnwindSafe for Context<'a>
impl<'a> Send for Context<'a>
impl<'a> Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> UnsafeUnpin for Context<'a>
impl<'a> !UnwindSafe for Context<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more