pub enum Filter {
Predicate(Predicate),
And(Vec<Filter>),
Or(Vec<Filter>),
Not(Box<Filter>),
}Expand description
Composite filter with logical operations
Variants§
Predicate(Predicate)
Single predicate
And(Vec<Filter>)
Logical AND of filters
Or(Vec<Filter>)
Logical OR of filters
Not(Box<Filter>)
Logical NOT of filter
Implementations§
Source§impl Filter
impl Filter
Sourcepub fn from_predicate(predicate: Predicate) -> Filter
pub fn from_predicate(predicate: Predicate) -> Filter
Create filter from predicate
Sourcepub fn ge(column: impl Into<String>, value: Value) -> Filter
pub fn ge(column: impl Into<String>, value: Value) -> Filter
Create greater-than-or-equal filter
Sourcepub fn between(column: impl Into<String>, low: Value, high: Value) -> Filter
pub fn between(column: impl Into<String>, low: Value, high: Value) -> Filter
Create between filter
Sourcepub fn like(column: impl Into<String>, pattern: impl Into<String>) -> Filter
pub fn like(column: impl Into<String>, pattern: impl Into<String>) -> Filter
Create LIKE filter
Sourcepub fn is_not_null(column: impl Into<String>) -> Filter
pub fn is_not_null(column: impl Into<String>) -> Filter
Create IS NOT NULL filter
Sourcepub fn and_filter(self, other: Filter) -> Filter
pub fn and_filter(self, other: Filter) -> Filter
Combine with another filter using AND
Sourcepub fn evaluate(&self, get_value: &impl Fn(&str) -> Option<Value>) -> bool
pub fn evaluate(&self, get_value: &impl Fn(&str) -> Option<Value>) -> bool
Evaluate filter against a row (column name -> value map)
Sourcepub fn references_column(&self, column: &str) -> bool
pub fn references_column(&self, column: &str) -> bool
Check if filter references a specific column
Sourcepub fn referenced_columns(&self) -> Vec<&str>
pub fn referenced_columns(&self) -> Vec<&str>
Get all referenced columns
Trait Implementations§
Auto Trait Implementations§
impl Forget for Filter
impl Freeze for Filterwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
PhantomData<f32>: Freeze,
PhantomData<Value>: Freeze,
*const ArcInner<CronSchedule> is !null: Freeze,
PhantomData<ArcInner<CronSchedule>>: Freeze,
PhantomData<Filter>: Freeze,
*const Filter is !null: Freeze,
impl Move for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnsafeUnpin for Filterwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
PhantomData<f32>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const ArcInner<CronSchedule> is !null: UnsafeUnpin,
PhantomData<ArcInner<CronSchedule>>: UnsafeUnpin,
PhantomData<Filter>: UnsafeUnpin,
*const Filter is !null: UnsafeUnpin,
impl UnwindSafe for Filterwhere
RawVecInner: UnwindSafe,
Arc<str>: UnwindSafe,
Arc<CronSchedule>: UnwindSafe,
BoxRaw<Filter>: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request