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 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§
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