LockLazyQuery

Struct LockLazyQuery 

Source
pub struct LockLazyQuery<'a, T: 'static, L, I>
where L: LockValue<T> + 'a, I: Iterator<Item = &'a L>,
{ /* private fields */ }
Expand description

Lazy query for locked data with early termination.

Implementations§

Source§

impl<'a, T: 'static, L, I> LockLazyQuery<'a, T, L, I>
where L: LockValue<T> + 'a, I: Iterator<Item = &'a L> + 'a,

Source

pub fn new(iter: I) -> Self

Create a new lazy query from an iterator of locks.

Source

pub fn where_<F, P>( self, path: KeyPaths<T, F>, predicate: P, ) -> LockLazyQuery<'a, T, L, impl Iterator<Item = &'a L> + 'a>
where F: 'static, P: Fn(&F) -> bool + 'a,

Filter using a key-path predicate (lazy).

Source

pub fn select_lazy<F>( self, path: KeyPaths<T, F>, ) -> impl Iterator<Item = F> + 'a
where F: Clone + 'static,

Map to a field value (lazy).

Source

pub fn take_lazy(self, n: usize) -> impl Iterator<Item = T> + 'a
where T: Clone,

Take first N items (lazy).

Source

pub fn skip_lazy( self, n: usize, ) -> LockLazyQuery<'a, T, L, impl Iterator<Item = &'a L> + 'a>

Skip first N items (lazy).

Source

pub fn count(self) -> usize

Count matching items (terminal).

Source

pub fn first(self) -> Option<T>
where T: Clone,

Get first matching item (terminal).

Source

pub fn any(self) -> bool

Check if any items match (terminal).

Source

pub fn collect(self) -> Vec<T>
where T: Clone,

Collect into Vec (terminal).

Auto Trait Implementations§

§

impl<'a, T, L, I> Freeze for LockLazyQuery<'a, T, L, I>
where I: Freeze,

§

impl<'a, T, L, I> RefUnwindSafe for LockLazyQuery<'a, T, L, I>

§

impl<'a, T, L, I> Send for LockLazyQuery<'a, T, L, I>
where I: Send, T: Sync,

§

impl<'a, T, L, I> Sync for LockLazyQuery<'a, T, L, I>
where I: Sync, T: Sync,

§

impl<'a, T, L, I> Unpin for LockLazyQuery<'a, T, L, I>
where I: Unpin,

§

impl<'a, T, L, I> UnwindSafe for LockLazyQuery<'a, T, L, I>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.