pub enum Filter {
Show 14 variants
Eq(String, Value),
Ne(String, Value),
Gt(String, Value),
Lt(String, Value),
Ge(String, Value),
In(String, Vec<Value>),
Json(String, JsonFilter),
Le(String, Value),
Like(String, String),
NotNull(String),
IsNull(String),
And(Box<Filter>, Box<Filter>),
Or(Box<Filter>, Box<Filter>),
Not(Box<Filter>),
}Expand description
super::Query filters.
The first value refers to the column name, and the second to the value to compare against.
Variants§
Eq(String, Value)
Ne(String, Value)
Gt(String, Value)
Lt(String, Value)
Ge(String, Value)
In(String, Vec<Value>)
Json(String, JsonFilter)
JSON filter applied to a column.
Le(String, Value)
Like(String, String)
NotNull(String)
IsNull(String)
And(Box<Filter>, Box<Filter>)
Or(Box<Filter>, Box<Filter>)
Not(Box<Filter>)
Implementations§
Source§impl Filter
impl Filter
Sourcepub fn json(field: &str, json_filter: JsonFilter) -> Self
pub fn json(field: &str, json_filter: JsonFilter) -> Self
Creates a JSON filter.
Sourcepub fn matches_joined_row(
&self,
table_groups: &[(&str, Vec<(ColumnDef, Value)>)],
) -> QueryResult<bool>
pub fn matches_joined_row( &self, table_groups: &[(&str, Vec<(ColumnDef, Value)>)], ) -> QueryResult<bool>
Checks if the given joined row values match the filter.
Each element in table_groups is a (table_name, columns) pair.
Column references can be qualified (“table.column”) or unqualified (“column”).
Unqualified names that exist in multiple tables produce an error.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Filter
impl<'de> Deserialize<'de> for Filter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Filter
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§
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