[][src]Struct jmespatch::Runtime

pub struct Runtime { /* fields omitted */ }

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.

Methods

impl Runtime[src]

pub fn new() -> Runtime[src]

Creates a new Runtime.

pub fn compile<'a>(
    &'a self,
    expression: &str
) -> Result<Expression<'a>, JmespathError>
[src]

Creates a new JMESPath expression from an expression string.

The provided expression is expected to adhere to the JMESPath grammar: http://jmespath.org/specification.html

pub fn register_function(&mut self, name: &str, f: Box<dyn Function>)[src]

Adds a new function to the runtime.

pub fn deregister_function(&mut self, name: &str) -> Option<Box<dyn Function>>[src]

Removes a function from the runtime.

Returns the function that was removed if it was found.

pub fn get_function<'a>(&'a self, name: &str) -> Option<&'a dyn Function>[src]

Gets a function by name from the runtime.

pub fn register_builtin_functions(&mut self)[src]

Registers all of the builtin JMESPath functions with the runtime.

Trait Implementations

impl Default for Runtime[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.