pub struct Runtime { /* private fields */ }Expand description
Compiles JMESPath expressions and manages registered functions.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn builder() -> RuntimeBuilder
pub fn builder() -> RuntimeBuilder
Creates a RuntimeBuilder for selective function registration.
Sourcepub fn compile<'a>(
&'a self,
expression: &str,
) -> Result<Expression<'a>, JmespathError>
pub fn compile<'a>( &'a self, expression: &str, ) -> Result<Expression<'a>, JmespathError>
Creates a new JMESPath expression from an expression string.
Sourcepub fn register_function(&mut self, name: &str, f: Box<dyn Function>)
pub fn register_function(&mut self, name: &str, f: Box<dyn Function>)
Adds a new function to the runtime.
Sourcepub fn deregister_function(&mut self, name: &str) -> Option<Box<dyn Function>>
pub fn deregister_function(&mut self, name: &str) -> Option<Box<dyn Function>>
Removes a function from the runtime.
Sourcepub fn get_function<'a>(&'a self, name: &str) -> Option<&'a dyn Function>
pub fn get_function<'a>(&'a self, name: &str) -> Option<&'a dyn Function>
Gets a function by name from the runtime.
Sourcepub fn function_names(&self) -> impl Iterator<Item = &str>
pub fn function_names(&self) -> impl Iterator<Item = &str>
Returns an iterator over all registered function names.
Sourcepub fn register_builtin_functions(&mut self)
pub fn register_builtin_functions(&mut self)
Registers all 26 built-in JMESPath functions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Runtime
impl !RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl !UnwindSafe for Runtime
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