pub enum Predicate {
And(Vec<Self>),
Or(Vec<Self>),
Not(Box<Self>),
Cmp {
left: Expr,
op: CmpOp,
right: Expr,
},
Between {
expr: Expr,
low: Expr,
high: Expr,
negated: bool,
},
In {
expr: Expr,
values: Vec<Expr>,
negated: bool,
},
Like {
expr: Expr,
pattern: String,
insensitive: bool,
negated: bool,
},
Null {
expr: Expr,
negated: bool,
},
InSubquery {
expr: Expr,
column: String,
table: String,
filter: Box<Self>,
negated: bool,
},
}Expand description
A recursive boolean predicate tree.
Variants§
And(Vec<Self>)
AND of all children (an empty list is the always-true identity 1 = 1).
Or(Vec<Self>)
OR of all children (an empty list is the always-false identity 1 = 0).
Not(Box<Self>)
Negation.
Cmp
<left> <op> <right>.
Between
<expr> [NOT] BETWEEN <low> AND <high>.
In
<expr> [NOT] IN (<values>). Empty values is the corresponding identity
(1 = 0 for IN (), 1 = 1 for NOT IN ()).
Like
<expr> [NOT] LIKE <pattern>; insensitive renders the portable
lower(<expr>) LIKE lower(<pattern>) (no dialect-specific ILIKE).
Null
<expr> IS [NOT] NULL.
InSubquery
<expr> [NOT] IN (SELECT <column> FROM <table> WHERE <filter>) — a narrow single-named-
table IN-subquery (the sibling of Expr::RelatedScalar; same safe-by-construction shape).
Trait Implementations§
impl StructuralPartialEq for Predicate
Auto Trait Implementations§
impl Freeze for Predicate
impl RefUnwindSafe for Predicate
impl Send for Predicate
impl Sync for Predicate
impl Unpin for Predicate
impl UnsafeUnpin for Predicate
impl UnwindSafe for Predicate
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