Skip to main content

FilterExpr

Enum FilterExpr 

Source
pub enum FilterExpr {
Show 32 variants True, False, And(Vec<FilterExpr>), Or(Vec<FilterExpr>), Not(Box<FilterExpr>), Eq { field: String, value: Value, }, EqCi { field: String, value: Value, }, Ne { field: String, value: Value, }, Lt { field: String, value: Value, }, Lte { field: String, value: Value, }, Gt { field: String, value: Value, }, Gte { field: String, value: Value, }, EqField { left_field: String, right_field: String, }, NeField { left_field: String, right_field: String, }, LtField { left_field: String, right_field: String, }, LteField { left_field: String, right_field: String, }, GtField { left_field: String, right_field: String, }, GteField { left_field: String, right_field: String, }, In { field: String, values: Vec<Value>, }, NotIn { field: String, values: Vec<Value>, }, Contains { field: String, value: Value, }, TextContains { field: String, value: Value, }, TextContainsCi { field: String, value: Value, }, StartsWith { field: String, value: Value, }, StartsWithCi { field: String, value: Value, }, EndsWith { field: String, value: Value, }, EndsWithCi { field: String, value: Value, }, IsNull { field: String, }, IsNotNull { field: String, }, IsMissing { field: String, }, IsEmpty { field: String, }, IsNotEmpty { field: String, },
}
Expand description

FilterExpr

Serialized, planner-agnostic filter language. This is the shared typed filter input model for fluent callers and lowers directly onto planner-owned boolean expressions at the intent boundary.

Variants§

§

True

§

False

§

And(Vec<FilterExpr>)

§

Or(Vec<FilterExpr>)

§

Not(Box<FilterExpr>)

§

Eq

Fields

§field: String
§value: Value
§

EqCi

Fields

§field: String
§value: Value
§

Ne

Fields

§field: String
§value: Value
§

Lt

Fields

§field: String
§value: Value
§

Lte

Fields

§field: String
§value: Value
§

Gt

Fields

§field: String
§value: Value
§

Gte

Fields

§field: String
§value: Value
§

EqField

Fields

§left_field: String
§right_field: String
§

NeField

Fields

§left_field: String
§right_field: String
§

LtField

Fields

§left_field: String
§right_field: String
§

LteField

Fields

§left_field: String
§right_field: String
§

GtField

Fields

§left_field: String
§right_field: String
§

GteField

Fields

§left_field: String
§right_field: String
§

In

Fields

§field: String
§values: Vec<Value>
§

NotIn

Fields

§field: String
§values: Vec<Value>
§

Contains

Fields

§field: String
§value: Value
§

TextContains

Fields

§field: String
§value: Value
§

TextContainsCi

Fields

§field: String
§value: Value
§

StartsWith

Fields

§field: String
§value: Value
§

StartsWithCi

Fields

§field: String
§value: Value
§

EndsWith

Fields

§field: String
§value: Value
§

EndsWithCi

Fields

§field: String
§value: Value
§

IsNull

Fields

§field: String
§

IsNotNull

Fields

§field: String
§

IsMissing

Fields

§field: String
§

IsEmpty

Fields

§field: String
§

IsNotEmpty

Fields

§field: String

Implementations§

Source§

impl FilterExpr

Source

pub const fn and(exprs: Vec<FilterExpr>) -> FilterExpr

Build an And expression from a list of child expressions.

Source

pub const fn or(exprs: Vec<FilterExpr>) -> FilterExpr

Build an Or expression from a list of child expressions.

Source

pub fn not(expr: FilterExpr) -> FilterExpr

Negate one child expression.

Source

pub fn eq(field: impl Into<String>, value: impl FieldValue) -> FilterExpr

Compare field == value.

Source

pub fn ne(field: impl Into<String>, value: impl FieldValue) -> FilterExpr

Compare field != value.

Source

pub fn lt(field: impl Into<String>, value: impl FieldValue) -> FilterExpr

Compare field < value.

Source

pub fn lte(field: impl Into<String>, value: impl FieldValue) -> FilterExpr

Compare field <= value.

Source

pub fn gt(field: impl Into<String>, value: impl FieldValue) -> FilterExpr

Compare field > value.

Source

pub fn gte(field: impl Into<String>, value: impl FieldValue) -> FilterExpr

Compare field >= value.

Source

pub fn eq_ci(field: impl Into<String>, value: impl FieldValue) -> FilterExpr

Compare field == value with casefolded text equality.

Source

pub fn eq_field( left_field: impl Into<String>, right_field: impl Into<String>, ) -> FilterExpr

Compare left_field == right_field.

Source

pub fn ne_field( left_field: impl Into<String>, right_field: impl Into<String>, ) -> FilterExpr

Compare left_field != right_field.

Source

pub fn lt_field( left_field: impl Into<String>, right_field: impl Into<String>, ) -> FilterExpr

Compare left_field < right_field.

Source

pub fn lte_field( left_field: impl Into<String>, right_field: impl Into<String>, ) -> FilterExpr

Compare left_field <= right_field.

Source

pub fn gt_field( left_field: impl Into<String>, right_field: impl Into<String>, ) -> FilterExpr

Compare left_field > right_field.

Source

pub fn gte_field( left_field: impl Into<String>, right_field: impl Into<String>, ) -> FilterExpr

Compare left_field >= right_field.

Source

pub fn in_list( field: impl Into<String>, values: impl IntoIterator<Item = impl FieldValue>, ) -> FilterExpr

Compare field IN values.

Source

pub fn not_in( field: impl Into<String>, values: impl IntoIterator<Item = impl FieldValue>, ) -> FilterExpr

Compare field NOT IN values.

Source

pub fn contains(field: impl Into<String>, value: impl FieldValue) -> FilterExpr

Compare collection field CONTAINS value.

Source

pub fn text_contains( field: impl Into<String>, value: impl FieldValue, ) -> FilterExpr

Compare case-sensitive substring containment.

Source

pub fn text_contains_ci( field: impl Into<String>, value: impl FieldValue, ) -> FilterExpr

Compare case-insensitive substring containment.

Source

pub fn starts_with( field: impl Into<String>, value: impl FieldValue, ) -> FilterExpr

Compare case-sensitive prefix match.

Source

pub fn starts_with_ci( field: impl Into<String>, value: impl FieldValue, ) -> FilterExpr

Compare case-insensitive prefix match.

Source

pub fn ends_with(field: impl Into<String>, value: impl FieldValue) -> FilterExpr

Compare case-sensitive suffix match.

Source

pub fn ends_with_ci( field: impl Into<String>, value: impl FieldValue, ) -> FilterExpr

Compare case-insensitive suffix match.

Source

pub fn is_null(field: impl Into<String>) -> FilterExpr

Match rows where field is present and null.

Source

pub fn is_not_null(field: impl Into<String>) -> FilterExpr

Match rows where field is present and non-null.

Source

pub fn is_missing(field: impl Into<String>) -> FilterExpr

Match rows where field is absent.

Source

pub fn is_empty(field: impl Into<String>) -> FilterExpr

Match rows where field is present and empty.

Source

pub fn is_not_empty(field: impl Into<String>) -> FilterExpr

Match rows where field is present and non-empty.

Trait Implementations§

Source§

impl CandidType for FilterExpr

Source§

fn _ty() -> Type

Source§

fn _ty_doc() -> TypeDoc

Source§

fn id() -> TypeId

Source§

fn idl_serialize<__S>( &self, __serializer: __S, ) -> Result<(), <__S as Serializer>::Error>
where __S: Serializer,

Source§

fn ty() -> Type

Source§

impl Clone for FilterExpr

Source§

fn clone(&self) -> FilterExpr

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 Debug for FilterExpr

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FilterExpr

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<FilterExpr, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for FilterExpr

Source§

fn eq(&self, other: &FilterExpr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for FilterExpr

Source§

impl StructuralPartialEq for FilterExpr

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,