pub struct Runtime { /* private fields */ }
Expand description
Compiles JMESPath expressions.
Most use cases don’t need to worry about how Runtime works. You really only need to create your own Runtimes if you are utilizing custom functions in your expressions.
Implementations
sourceimpl Runtime
impl Runtime
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.
The provided expression is expected to adhere to the JMESPath grammar: https://jmespath.org/specification.html
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.
Returns the function that was removed if it was found.
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 register_builtin_functions(&mut self)
pub fn register_builtin_functions(&mut self)
Registers all of the builtin JMESPath functions with the runtime.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Runtime
impl !Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl !UnwindSafe for Runtime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more