Expr

Enum Expr 

Source
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

Fields

§left: ScalarExpr<F>
§right: ScalarExpr<F>
§

InList

Fields

§expr: ScalarExpr<F>
§list: Vec<ScalarExpr<F>>
§negated: bool
§

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.

Fields

§expr: ScalarExpr<F>
§negated: bool
§

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>

Source

pub fn all_of(fs: Vec<Filter<'a, F>>) -> Expr<'a, F>

Build an AND of filters.

Source

pub fn any_of(fs: Vec<Filter<'a, F>>) -> Expr<'a, F>

Build an OR of filters.

Source

pub fn not(e: Expr<'a, F>) -> Expr<'a, F>

Wrap an expression in a logical NOT.

Source

pub fn is_full_range_for(&self, expected_field: &F) -> bool
where F: PartialEq,

Returns true if this expression is a full range filter on the provided field id.

Source

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”.

Source§

impl<'a, F> Expr<'a, F>
where F: Display + Copy,

Source

pub fn format_display(&self) -> String

Render a predicate expression as a human-readable string.

Trait Implementations§

Source§

impl<'a, F: Clone> Clone for Expr<'a, F>

Source§

fn clone(&self) -> Expr<'a, F>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, F: Debug> Debug for Expr<'a, F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,