#[non_exhaustive]pub enum Filter {
Compare {
column: String,
op: CompareOp,
value: Scalar,
},
IsNull(String),
Contains {
column: String,
text: String,
},
All(Vec<Filter>),
Any(Vec<Filter>),
Not(Box<Filter>),
}Expand description
Which rows a view shows. Dates, times, timestamps and durations compare as their integer
count of units (milliseconds since the epoch for Timestamp(Millisecond)).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Compare
column op value; unknown when the column is null.
IsNull(String)
The column is null. Works on columns of any type.
Contains
The string column contains text (case-sensitive); unknown when null.
All(Vec<Filter>)
Every filter holds (true for none).
Any(Vec<Filter>)
Some filter holds (false for none).
Not(Box<Filter>)
The filter does not hold (unknown stays unknown).
Implementations§
Source§impl Filter
impl Filter
Sourcepub fn compare(column: impl Into<String>, op: CompareOp, value: Scalar) -> Self
pub fn compare(column: impl Into<String>, op: CompareOp, value: Scalar) -> Self
column op value.
Sourcepub fn is_not_null(column: impl Into<String>) -> Self
pub fn is_not_null(column: impl Into<String>) -> Self
The column is not null.
Sourcepub fn contains(column: impl Into<String>, text: impl Into<String>) -> Self
pub fn contains(column: impl Into<String>, text: impl Into<String>) -> Self
The string column contains text.
Sourcepub fn all(filters: impl IntoIterator<Item = Filter>) -> Self
pub fn all(filters: impl IntoIterator<Item = Filter>) -> Self
Every one of filters holds.
Sourcepub fn any(filters: impl IntoIterator<Item = Filter>) -> Self
pub fn any(filters: impl IntoIterator<Item = Filter>) -> Self
At least one of filters holds.
Trait Implementations§
impl StructuralPartialEq for Filter
Auto Trait Implementations§
impl Freeze for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnsafeUnpin for Filter
impl UnwindSafe for Filter
Blanket Implementations§
impl<T> Allocation for T
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