pub enum Ast {
Show 18 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: Rcvar,
},
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>,
},
}
Expand description
A JMESPath expression abstract syntax tree.
Variants§
Comparison
Compares two nodes using a comparator, returning true/false.
Fields
comparator: Comparator
Comparator that compares the two results
Condition
If predicate
evaluates to a truthy value, returns the
result then
Fields
Identity
Returns the current node.
Expref
Used by functions to dynamically evaluate argument values.
Fields
Flatten
Evaluates the node, then flattens it one level.
Fields
Function
Function name and a vec or function argument expressions.
Fields
Field
Extracts a key by name from a map.
Fields
Index
Extracts an index from a Vec.
Fields
Literal
Resolves to a literal value.
Fields
MultiList
Evaluates to a list of evaluated expressions.
Fields
MultiHash
Evaluates to a map of key value pairs.
Fields
elements: Vec<KeyValuePair>
Elements of the hash
Not
Evaluates to true/false based on if the expression is not truthy.
Fields
Projection
Evaluates LHS, and pushes each value through RHS.
Fields
ObjectValues
Evaluates LHS. If it resolves to an object, returns a Vec of values.
Fields
And
Evaluates LHS. If not truthy returns. Otherwise evaluates RHS.
Fields
Or
Evaluates LHS. If truthy returns. Otherwise evaluates RHS.
Fields
Slice
Returns a slice of a vec, using start, stop, and step.
Fields
Subexpr
Evaluates RHS, then provides that value to the evaluation of RHS.