pub enum GuardExpr {
FunctionCall {
name: String,
args: Vec<GuardExpr>,
},
And(Box<GuardExpr>, Box<GuardExpr>),
Or(Box<GuardExpr>, Box<GuardExpr>),
Not(Box<GuardExpr>),
Comparison {
left: Box<GuardExpr>,
op: ComparisonOp,
right: Box<GuardExpr>,
},
StringLiteral(String),
NumberLiteral(i64),
BoolLiteral(bool),
}Expand description
A node in the guard expression abstract syntax tree.
Variants§
FunctionCall
A call to a built-in assertion function, e.g. table_exists("users").
Fields
And(Box<GuardExpr>, Box<GuardExpr>)
Logical AND of two expressions.
Or(Box<GuardExpr>, Box<GuardExpr>)
Logical OR of two expressions.
Not(Box<GuardExpr>)
Logical NOT of an expression.
Comparison
A comparison between two expressions.
Fields
§
op: ComparisonOpComparison operator.
StringLiteral(String)
A string literal (double-quoted).
NumberLiteral(i64)
A numeric literal.
BoolLiteral(bool)
A boolean literal (true / false).
Trait Implementations§
impl Eq for GuardExpr
impl StructuralPartialEq for GuardExpr
Auto Trait Implementations§
impl Freeze for GuardExpr
impl RefUnwindSafe for GuardExpr
impl Send for GuardExpr
impl Sync for GuardExpr
impl Unpin for GuardExpr
impl UnsafeUnpin for GuardExpr
impl UnwindSafe for GuardExpr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.