LockIterExt

Trait LockIterExt 

Source
pub trait LockIterExt<'a, T, L>: Sized + Iterator<Item = LockedValueRef<'a, T, L>>
where T: 'a, L: LockValue<T> + 'a,
{ // Provided methods fn filter_locked<F>(self, predicate: F) -> LockFilterIter<'a, T, L, Self, F> where F: Fn(&T) -> bool { ... } fn map_locked<F, R>(self, f: F) -> impl Iterator<Item = R> + 'a where F: Fn(&T) -> R + 'a, Self: 'a { ... } fn count_locked<F>(self, predicate: F) -> usize where F: Fn(&T) -> bool, Self: 'a { ... } fn find_locked<F>(self, predicate: F) -> Option<LockedValueRef<'a, T, L>> where F: Fn(&T) -> bool { ... } fn any_locked<F>(self, predicate: F) -> bool where F: Fn(&T) -> bool { ... } fn collect_cloned(self) -> Vec<T> where T: Clone, Self: 'a { ... } }
Expand description

Extension methods for lock iterators.

Provided Methods§

Source

fn filter_locked<F>(self, predicate: F) -> LockFilterIter<'a, T, L, Self, F>
where F: Fn(&T) -> bool,

Filter locked values by a predicate.

Source

fn map_locked<F, R>(self, f: F) -> impl Iterator<Item = R> + 'a
where F: Fn(&T) -> R + 'a, Self: 'a,

Map locked values to a new type.

Source

fn count_locked<F>(self, predicate: F) -> usize
where F: Fn(&T) -> bool, Self: 'a,

Count locked values matching a predicate.

Source

fn find_locked<F>(self, predicate: F) -> Option<LockedValueRef<'a, T, L>>
where F: Fn(&T) -> bool,

Find first locked value matching a predicate.

Source

fn any_locked<F>(self, predicate: F) -> bool
where F: Fn(&T) -> bool,

Check if any locked value matches a predicate.

Source

fn collect_cloned(self) -> Vec<T>
where T: Clone, Self: 'a,

Collect locked values into a Vec by cloning (when needed).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, T, L, I> LockIterExt<'a, T, L> for I
where T: 'a, L: LockValue<T> + 'a, I: Iterator<Item = LockedValueRef<'a, T, L>>,