pub enum Expr<'a, F> {
And(Vec<Expr<'a, F>>),
Or(Vec<Expr<'a, F>>),
Not(Box<Expr<'a, F>>),
Pred(Filter<'a, F>),
Compare {
left: ScalarExpr<F>,
op: CompareOp,
right: ScalarExpr<F>,
},
InList {
expr: ScalarExpr<F>,
list: Vec<ScalarExpr<F>>,
negated: bool,
},
IsNull {
expr: ScalarExpr<F>,
negated: bool,
},
Literal(bool),
Exists(SubqueryExpr),
}Expand description
Logical expression over predicates.
Variants§
And(Vec<Expr<'a, F>>)
Or(Vec<Expr<'a, F>>)
Not(Box<Expr<'a, F>>)
Pred(Filter<'a, F>)
Compare
InList
IsNull
Check if a scalar expression IS NULL or IS NOT NULL.
For simple column references, prefer Pred(Filter { op: IsNull/IsNotNull }) for optimization.
This variant handles complex expressions like (col1 + col2) IS NULL.
Literal(bool)
A literal boolean value (true/false). Used for conditions that are always true or always false (e.g., empty IN lists).
Exists(SubqueryExpr)
Correlated subquery evaluated in a boolean context.
Implementations§
Source§impl<'a, F> Expr<'a, F>
impl<'a, F> Expr<'a, F>
Sourcepub fn is_full_range_for(&self, expected_field: &F) -> boolwhere
F: PartialEq,
pub fn is_full_range_for(&self, expected_field: &F) -> boolwhere
F: PartialEq,
Returns true if this expression is a full range filter on the provided field id.
Sourcepub fn is_trivially_true(&self) -> bool
pub fn is_trivially_true(&self) -> bool
Returns true when the expression cannot filter out any rows.
Used by scan planners/executors to skip extra work when the caller effectively requested “no filter”.
Trait Implementations§
Auto Trait Implementations§
impl<'a, F> Freeze for Expr<'a, F>where
F: Freeze,
impl<'a, F> RefUnwindSafe for Expr<'a, F>where
F: RefUnwindSafe,
impl<'a, F> Send for Expr<'a, F>where
F: Send,
impl<'a, F> Sync for Expr<'a, F>where
F: Sync,
impl<'a, F> Unpin for Expr<'a, F>where
F: Unpin,
impl<'a, F> UnwindSafe for Expr<'a, F>where
F: UnwindSafe,
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