[−][src]Struct jmespatch::Expression
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.
Methods
impl<'a> Expression<'a>
[src]
pub fn new<S>(expression: S, ast: Ast, runtime: &'a Runtime) -> Expression<'a> where
S: Into<String>,
[src]
S: Into<String>,
Creates a new JMESPath expression.
Normally you will create expressions using either jmespatch::compile()
or using a jmespatch::Runtime.
pub fn search<T: ToJmespath>(&self, data: T) -> Result<Rcvar, JmespathError>
[src]
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.
pub fn as_str(&self) -> &str
[src]
Returns the JMESPath expression from which the Expression was compiled.
Note that this is the same value that is returned by calling
to_string
.
pub fn as_ast(&self) -> &Ast
[src]
Returns the AST of the parsed JMESPath expression.
This can be useful for debugging purposes, caching, etc.
Trait Implementations
impl<'a> Clone for Expression<'a>
[src]
fn clone(&self) -> Expression<'a>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for Expression<'a>
[src]
impl<'a> Display for Expression<'a>
[src]
impl<'a> PartialEq<Expression<'a>> for Expression<'a>
[src]
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Expression<'a>
impl<'a> !Send for Expression<'a>
impl<'a> !Sync for Expression<'a>
impl<'a> Unpin for Expression<'a>
impl<'a> !UnwindSafe for Expression<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,