Struct orx_concurrent_iter::ConIterOfVec
source · pub struct ConIterOfVec<T: Send + Sync + Default> { /* private fields */ }
Expand description
A concurrent iterator over a vector, consuming the vector and yielding its elements.
Implementations§
Trait Implementations§
source§impl<T: Send + Sync + Default> AtomicIter<T> for ConIterOfVec<T>
impl<T: Send + Sync + Default> AtomicIter<T> for ConIterOfVec<T>
source§fn counter(&self) -> &AtomicCounter
fn counter(&self) -> &AtomicCounter
Returns a reference to the underlying advanced item counter.
source§fn get(&self, item_idx: usize) -> Option<T>
fn get(&self, item_idx: usize) -> Option<T>
Returns the
item_idx
-th item that the iterator yields; returns None if the iterator completes before.source§fn fetch_n(&self, n: usize) -> impl NextChunk<T>
fn fetch_n(&self, n: usize) -> impl NextChunk<T>
Returns an iterator of the next
n
consecutive items that the iterator yields.
It might return an iterator of less or no items if the iteration does not have sufficient elements left.source§fn for_each_n<F: FnMut(T)>(&self, chunk_size: usize, f: F)
fn for_each_n<F: FnMut(T)>(&self, chunk_size: usize, f: F)
Applies the function
f
to each element of the iterator concurrently. Read moresource§fn enumerate_for_each_n<F: FnMut(usize, T)>(&self, chunk_size: usize, f: F)
fn enumerate_for_each_n<F: FnMut(usize, T)>(&self, chunk_size: usize, f: F)
Applies the function
f
to each element and its corresponding index of the iterator concurrently.
It may be considered as the concurrent counterpart of the chain of enumerate
and for_each_n
calls. Read moresource§impl<T: Send + Sync + Default> AtomicIterWithInitialLen<T> for ConIterOfVec<T>
impl<T: Send + Sync + Default> AtomicIterWithInitialLen<T> for ConIterOfVec<T>
source§fn initial_len(&self) -> usize
fn initial_len(&self) -> usize
Returns the initial length of the atomic iterator.
source§fn fetch_n_with_exact_len(
&self,
n: usize
) -> NextManyExact<T, impl ExactSizeIterator<Item = T>>
fn fetch_n_with_exact_len( &self, n: usize ) -> NextManyExact<T, impl ExactSizeIterator<Item = T>>
Returns an iterator of the next
n
consecutive items that the iterator together with an exact size iterator.
It might return an iterator of less or no items if the iteration does not have sufficient elements left.source§impl<T: Send + Sync + Default> ConcurrentIter for ConIterOfVec<T>
impl<T: Send + Sync + Default> ConcurrentIter for ConIterOfVec<T>
source§fn next_id_and_value(&self) -> Option<Next<Self::Item>>
fn next_id_and_value(&self) -> Option<Next<Self::Item>>
Advances the iterator and returns the next value together with its enumeration index. Read more
source§fn next_chunk(&self, chunk_size: usize) -> impl NextChunk<Self::Item>
fn next_chunk(&self, chunk_size: usize) -> impl NextChunk<Self::Item>
Advances the iterator
chunk_size
times and returns an iterator of at most chunk_size
consecutive next values.
Further, the beginning enumeration index of the yielded values is returned. Read moresource§fn for_each_n<F: FnMut(Self::Item)>(&self, chunk_size: usize, f: F)
fn for_each_n<F: FnMut(Self::Item)>(&self, chunk_size: usize, f: F)
Applies the function
fun
to each element of the iterator concurrently. Read moresource§fn enumerate_for_each_n<F: FnMut(usize, Self::Item)>(
&self,
chunk_size: usize,
f: F
)
fn enumerate_for_each_n<F: FnMut(usize, Self::Item)>( &self, chunk_size: usize, f: F )
Applies the function
fun
to each index and corresponding element of the iterator concurrently. Read moresource§fn fold<B, Fold>(&self, chunk_size: usize, neutral: B, fold: Fold) -> B
fn fold<B, Fold>(&self, chunk_size: usize, neutral: B, fold: Fold) -> B
Folds the elements of the iterator pulled concurrently using
fold
function. Read moresource§fn next(&self) -> Option<Self::Item>
fn next(&self) -> Option<Self::Item>
Advances the iterator and returns the next value. Read more
source§fn values(&self) -> ConIterValues<'_, Self> ⓘwhere
Self: Sized,
fn values(&self) -> ConIterValues<'_, Self> ⓘwhere
Self: Sized,
Returns an
Iterator
over the values of elements of the concurrent iterator. Read moresource§fn ids_and_values(&self) -> ConIterIdsAndValues<'_, Self> ⓘwhere
Self: Sized,
fn ids_and_values(&self) -> ConIterIdsAndValues<'_, Self> ⓘwhere
Self: Sized,
Returns an
Iterator
over the ids and values of elements of the concurrent iterator. Read moresource§impl<T: Send + Sync + Default> ExactSizeConcurrentIter for ConIterOfVec<T>
impl<T: Send + Sync + Default> ExactSizeConcurrentIter for ConIterOfVec<T>
source§fn next_exact_chunk(
&self,
chunk_size: usize
) -> Option<NextManyExact<Self::Item, impl ExactSizeIterator<Item = Self::Item>>>
fn next_exact_chunk( &self, chunk_size: usize ) -> Option<NextManyExact<Self::Item, impl ExactSizeIterator<Item = Self::Item>>>
Returns the next chunk with the requested
chunk_size
: Read moreimpl<T: Send + Sync + Default> Send for ConIterOfVec<T>
impl<T: Send + Sync + Default> Sync for ConIterOfVec<T>
Auto Trait Implementations§
impl<T> !Freeze for ConIterOfVec<T>
impl<T> !RefUnwindSafe for ConIterOfVec<T>
impl<T> Unpin for ConIterOfVec<T>where
T: Unpin,
impl<T> UnwindSafe for ConIterOfVec<T>where
T: 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