pub struct Expression<'a> { /* private fields */ }
Expand description

A compiled JMESPath expression.

The compiled expression can be used multiple times without incurring the cost of re-parsing the expression each time. The expression may be shared between threads if JMESPath is compiled with the sync feature, which forces the use of an Arc instead of an Rc for runtime variables.

Implementations

Creates a new JMESPath expression.

Normally you will create expressions using either jmespath::compile() or using a jmespath::Runtime.

Returns the result of searching data with the compiled expression.

The SearchResult contains a JMESPath Rcvar, or a reference counted Variable. This value can be used directly like a JSON object. Alternatively, Variable does implement Serde serialzation and deserialization, so it can easily be marshalled to another type.

Returns the JMESPath expression from which the Expression was compiled.

Note that this is the same value that is returned by calling to_string.

Returns the AST of the parsed JMESPath expression.

This can be useful for debugging purposes, caching, etc.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Shows the jmespath expression as a string.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.