pub enum AbstractQuery<K, V> {
And(Vec<Self>),
Or(Vec<Self>),
Not(Box<Self>),
Eq(K, V),
Neq(K, V),
Gt(K, V),
Gte(K, V),
Lt(K, V),
Lte(K, V),
Like(K, V),
In(K, Vec<V>),
Exist(Vec<K>),
}Expand description
An abstract query representation over a key and value type
Variants§
And(Vec<Self>)
Logical AND of multiple clauses
Or(Vec<Self>)
Logical OR of multiple clauses
Not(Box<Self>)
Negation of a clause
Eq(K, V)
Equality comparison for a field value
Neq(K, V)
Inequality comparison for a field value
Gt(K, V)
Greater-than comparison for a field value
Gte(K, V)
Greater-than-or-equal comparison for a field value
Lt(K, V)
Less-than comparison for a field value
Lte(K, V)
Less-than-or-equal comparison for a field value
Like(K, V)
SQL ‘LIKE’-compatible string comparison for a field value
In(K, Vec<V>)
Match one of multiple field values in a set
Exist(Vec<K>)
Match any non-null field value of the given field names
Implementations§
Source§impl<K, V> AbstractQuery<K, V>
impl<K, V> AbstractQuery<K, V>
Sourcepub fn map_names<RK, E>(
self,
f: impl FnMut(K) -> Result<RK, E>,
) -> Result<AbstractQuery<RK, V>, E>
pub fn map_names<RK, E>( self, f: impl FnMut(K) -> Result<RK, E>, ) -> Result<AbstractQuery<RK, V>, E>
Perform a transformation on all field names in query clauses
Sourcepub fn map_values<RV, E>(
self,
f: impl FnMut(&K, V) -> Result<RV, E>,
) -> Result<AbstractQuery<K, RV>, E>
pub fn map_values<RV, E>( self, f: impl FnMut(&K, V) -> Result<RV, E>, ) -> Result<AbstractQuery<K, RV>, E>
Perform a transformation on all field values in query clauses
Trait Implementations§
Source§impl<K: Clone, V: Clone> Clone for AbstractQuery<K, V>
impl<K: Clone, V: Clone> Clone for AbstractQuery<K, V>
Source§fn clone(&self) -> AbstractQuery<K, V>
fn clone(&self) -> AbstractQuery<K, V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K, V> Default for AbstractQuery<K, V>
impl<K, V> Default for AbstractQuery<K, V>
Source§impl<K: Ord, V: Ord> Ord for AbstractQuery<K, V>
impl<K: Ord, V: Ord> Ord for AbstractQuery<K, V>
Source§fn cmp(&self, other: &AbstractQuery<K, V>) -> Ordering
fn cmp(&self, other: &AbstractQuery<K, V>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<K: PartialOrd, V: PartialOrd> PartialOrd for AbstractQuery<K, V>
impl<K: PartialOrd, V: PartialOrd> PartialOrd for AbstractQuery<K, V>
Source§impl<K, V> Serialize for AbstractQuery<K, V>
impl<K, V> Serialize for AbstractQuery<K, V>
impl<K: Eq, V: Eq> Eq for AbstractQuery<K, V>
impl<K, V> StructuralPartialEq for AbstractQuery<K, V>
Auto Trait Implementations§
impl<K, V> Freeze for AbstractQuery<K, V>
impl<K, V> RefUnwindSafe for AbstractQuery<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for AbstractQuery<K, V>
impl<K, V> Sync for AbstractQuery<K, V>
impl<K, V> Unpin for AbstractQuery<K, V>
impl<K, V> UnwindSafe for AbstractQuery<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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