pub enum Ast {
Show 20 variants
Comparison {
offset: usize,
comparator: Comparator,
lhs: Box<Ast>,
rhs: Box<Ast>,
},
Condition {
offset: usize,
predicate: Box<Ast>,
then: Box<Ast>,
},
Identity {
offset: usize,
},
Expref {
offset: usize,
ast: Box<Ast>,
},
Flatten {
offset: usize,
node: Box<Ast>,
},
Function {
offset: usize,
name: String,
args: Vec<Ast>,
},
Field {
offset: usize,
name: String,
},
Index {
offset: usize,
idx: i32,
},
Literal {
offset: usize,
value: Value,
},
MultiList {
offset: usize,
elements: Vec<Ast>,
},
MultiHash {
offset: usize,
elements: Vec<KeyValuePair>,
},
Not {
offset: usize,
node: Box<Ast>,
},
Projection {
offset: usize,
lhs: Box<Ast>,
rhs: Box<Ast>,
},
ObjectValues {
offset: usize,
node: Box<Ast>,
},
And {
offset: usize,
lhs: Box<Ast>,
rhs: Box<Ast>,
},
Or {
offset: usize,
lhs: Box<Ast>,
rhs: Box<Ast>,
},
Slice {
offset: usize,
start: Option<i32>,
stop: Option<i32>,
step: i32,
},
Subexpr {
offset: usize,
lhs: Box<Ast>,
rhs: Box<Ast>,
},
VariableRef {
offset: usize,
name: String,
},
Let {
offset: usize,
bindings: Vec<(String, Ast)>,
expr: Box<Ast>,
},
}Expand description
Represents a JMESPath AST node.
Variants§
Comparison
Compares two nodes using a comparator (e.g., foo == bar).
Condition
Returns the RHS if the predicate yields a truthy value.
Identity
Returns the current node.
Expref
Expression reference (used by sort_by, max_by, etc.).
Flatten
Flattens nested arrays.
Function
Calls a function with the given arguments.
Field
Extracts a field from an object.
Index
Accesses an element by index.
Literal
A literal JSON value.
MultiList
Multi-select list (e.g., [foo, bar]).
MultiHash
Multi-select hash (e.g., {foo: bar, baz: qux}).
Not
Negation (e.g., !expr).
Projection
Projects the RHS over each element of the LHS array.
ObjectValues
Converts an object into an array of its values.
And
Logical AND.
Or
Logical OR.
Slice
Slices an array (e.g., [0:5:2]).
Subexpr
Sub-expression (e.g., foo.bar).
VariableRef
JEP-18: Variable reference (e.g., $name).
Let
JEP-18: Let expression (e.g., let $x = expr in body).
Trait Implementations§
impl StructuralPartialEq for Ast
Auto Trait Implementations§
impl Freeze for Ast
impl RefUnwindSafe for Ast
impl Send for Ast
impl Sync for Ast
impl Unpin for Ast
impl UnsafeUnpin for Ast
impl UnwindSafe for Ast
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more