pub struct Expr { /* private fields */ }Expand description
Expr is a compiled JMESPath expression, kept with the source text it
was compiled from.
Implementations§
Source§impl Expr
impl Expr
Sourcepub fn compile(source: &str) -> Result<Expr>
pub fn compile(source: &str) -> Result<Expr>
compile compiles source. A parse failure is an Error::Query
that carries the jmespath crate’s message.
Sourcepub fn eval(&self, value: &Value) -> Result<Value>
pub fn eval(&self, value: &Value) -> Result<Value>
eval evaluates the expression against value. An object in the
result keeps the key order that it was read with. An object literal in
the expression is the exception: its keys come out sorted, because the
jmespath crate parses it into a sorted map. A runtime
failure is an Error::Query.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Expr
impl !Send for Expr
impl !Sync for Expr
impl !UnwindSafe for Expr
impl Forget for Expr
impl Freeze for Expr
impl Move for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
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