pub struct LockQuery<'a, T: 'static, L>where
L: LockValue<T> + 'a,{ /* private fields */ }Expand description
A query builder for locked data structures.
Provides full SQL-like query operations (WHERE, SELECT, ORDER BY, GROUP BY) on collections of locked values without unnecessary copying.
Implementations§
Source§impl<'a, T: 'static, L> LockQuery<'a, T, L>where
L: LockValue<T> + 'a,
impl<'a, T: 'static, L> LockQuery<'a, T, L>where
L: LockValue<T> + 'a,
Sourcepub fn from_locks(locks: Vec<&'a L>) -> Self
pub fn from_locks(locks: Vec<&'a L>) -> Self
Sourcepub fn where_<F>(
self,
path: KeyPaths<T, F>,
predicate: impl Fn(&F) -> bool + 'a,
) -> Selfwhere
F: 'static,
pub fn where_<F>(
self,
path: KeyPaths<T, F>,
predicate: impl Fn(&F) -> bool + 'a,
) -> Selfwhere
F: 'static,
Sourcepub fn order_by_desc<F>(&self, path: KeyPaths<T, F>) -> Vec<T>
pub fn order_by_desc<F>(&self, path: KeyPaths<T, F>) -> Vec<T>
Order by a field descending.
Sourcepub fn order_by_float(&self, path: KeyPaths<T, f64>) -> Vec<T>where
T: Clone,
pub fn order_by_float(&self, path: KeyPaths<T, f64>) -> Vec<T>where
T: Clone,
Order by float field.
Sourcepub fn order_by_float_desc(&self, path: KeyPaths<T, f64>) -> Vec<T>where
T: Clone,
pub fn order_by_float_desc(&self, path: KeyPaths<T, f64>) -> Vec<T>where
T: Clone,
Order by float field descending.
Sourcepub fn sum_timestamp(&self, path: KeyPaths<T, i64>) -> i64
pub fn sum_timestamp(&self, path: KeyPaths<T, i64>) -> i64
Sourcepub fn count_timestamp(&self, path: KeyPaths<T, i64>) -> usize
pub fn count_timestamp(&self, path: KeyPaths<T, i64>) -> usize
Sourcepub fn where_after_timestamp(
self,
path: KeyPaths<T, i64>,
reference: i64,
) -> Self
pub fn where_after_timestamp( self, path: KeyPaths<T, i64>, reference: i64, ) -> Self
Sourcepub fn where_before_timestamp(
self,
path: KeyPaths<T, i64>,
reference: i64,
) -> Self
pub fn where_before_timestamp( self, path: KeyPaths<T, i64>, reference: i64, ) -> Self
Sourcepub fn where_last_days_timestamp(
self,
path: KeyPaths<T, i64>,
days: i64,
) -> Self
pub fn where_last_days_timestamp( self, path: KeyPaths<T, i64>, days: i64, ) -> Self
Sourcepub fn where_next_days_timestamp(
self,
path: KeyPaths<T, i64>,
days: i64,
) -> Self
pub fn where_next_days_timestamp( self, path: KeyPaths<T, i64>, days: i64, ) -> Self
Sourcepub fn where_last_hours_timestamp(
self,
path: KeyPaths<T, i64>,
hours: i64,
) -> Self
pub fn where_last_hours_timestamp( self, path: KeyPaths<T, i64>, hours: i64, ) -> Self
Sourcepub fn where_next_hours_timestamp(
self,
path: KeyPaths<T, i64>,
hours: i64,
) -> Self
pub fn where_next_hours_timestamp( self, path: KeyPaths<T, i64>, hours: i64, ) -> Self
Sourcepub fn where_last_minutes_timestamp(
self,
path: KeyPaths<T, i64>,
minutes: i64,
) -> Self
pub fn where_last_minutes_timestamp( self, path: KeyPaths<T, i64>, minutes: i64, ) -> Self
Sourcepub fn where_next_minutes_timestamp(
self,
path: KeyPaths<T, i64>,
minutes: i64,
) -> Self
pub fn where_next_minutes_timestamp( self, path: KeyPaths<T, i64>, minutes: i64, ) -> Self
Auto Trait Implementations§
impl<'a, T, L> Freeze for LockQuery<'a, T, L>
impl<'a, T, L> !RefUnwindSafe for LockQuery<'a, T, L>
impl<'a, T, L> !Send for LockQuery<'a, T, L>
impl<'a, T, L> !Sync for LockQuery<'a, T, L>
impl<'a, T, L> Unpin for LockQuery<'a, T, L>where
T: Unpin,
impl<'a, T, L> !UnwindSafe for LockQuery<'a, T, L>
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