Struct orx_concurrent_iter::Cloned

source ·
pub struct Cloned<'a, T, A>
where T: Send + Sync + Clone, A: AtomicIter<&'a T>,
{ /* private fields */ }
Expand description

An concurrent iterator, backed with an atomic iterator, that clones the elements of an underlying iterator.

This struct is created by the cloned method on the concurrent iterator.

Trait Implementations§

source§

impl<'a, T, A> AtomicIter<T> for Cloned<'a, T, A>
where T: Send + Sync + Clone, A: AtomicIter<&'a T>,

source§

fn counter(&self) -> &AtomicCounter

Returns a reference to the underlying advanced item counter.
source§

fn progress_and_get_begin_idx(&self, number_to_fetch: usize) -> Option<usize>

Progresses the atomic counter by number_to_fetch elements and returns the beginning index of the elements to be fetched. Returns None if the iterator is terminated and there are no more elements to be fetched. Read more
source§

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, ) -> Option<NextChunk<T, impl ExactSizeIterator<Item = 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 early_exit(&self)

Skips all remaining elements of the iterator and assumes that the end of the iterator is reached. Read more
source§

fn fetch_one(&self) -> Option<Next<T>>

Returns the next item that the iterator yields; returns None if the iteration has completed.
source§

impl<'a, T, A> AtomicIterWithInitialLen<T> for Cloned<'a, T, A>

source§

fn initial_len(&self) -> usize

Returns the initial length of the atomic iterator.
source§

impl<'a, T, A> ConcurrentIter for Cloned<'a, T, A>
where T: Send + Sync + Clone, A: AtomicIter<&'a T> + ConcurrentIter<Item = &'a T>,

source§

type Item = T

Type of the items that the iterator yields.
source§

type BufferedIter = ClonedBufferedChunk<'a, T, <A as ConcurrentIter>::BufferedIter>

Type of the buffered iterator returned by the chunk_iter method when elements are fetched in chunks by each thread.
source§

type SeqIter = Cloned<<A as ConcurrentIter>::SeqIter>

Inner type which is the source of the data to be iterated, which in addition is a regular sequential Iterator.
source§

fn into_seq_iter(self) -> Self::SeqIter

Converts the concurrent iterator back to the original wrapped type which is the source of the elements to be iterated. Already progressed elements are skipped.
source§

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, ) -> Option<NextChunk<Self::Item, impl ExactSizeIterator<Item = 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 more
source§

fn buffered_iter( &self, chunk_size: usize, ) -> BufferedIter<'_, Self::Item, Self::BufferedIter>

Creates an iterator which pulls elements from this iterator as chunks of the given chunk_size. Read more
source§

fn skip_to_end(&self)

Skips all remaining elements of the iterator and assumes that the end of the iterator is reached. Read more
source§

fn try_get_len(&self) -> Option<usize>

Returns Some of the remaining length of the iterator if it is known; returns None otherwise.
source§

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,

Returns an Iterator over the values of elements of the concurrent iterator. Read more
source§

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 more
source§

fn for_each<Fun: FnMut(Self::Item)>(&self, chunk_size: usize, fun: Fun)
where Self: Sized,

Applies the function fun to each element of the iterator concurrently. Read more
source§

fn enumerate_for_each<Fun: FnMut(usize, Self::Item)>( &self, chunk_size: usize, fun: Fun, )
where Self: Sized,

Applies the function fun to each index and corresponding element of the iterator concurrently. Read more
source§

fn fold<B, Fold>(&self, chunk_size: usize, neutral: B, fold: Fold) -> B
where Fold: FnMut(B, Self::Item) -> B, Self: Sized,

Folds the elements of the iterator pulled concurrently using fold function. Read more
source§

fn has_more(&self) -> HasMore

Returns whether or not the concurrent iterator has more elements to yield. Read more
source§

impl<'a, T, A> Send for Cloned<'a, T, A>
where T: Send + Sync + Clone, A: AtomicIter<&'a T>,

source§

impl<'a, T, A> Sync for Cloned<'a, T, A>
where T: Send + Sync + Clone, A: AtomicIter<&'a T>,

Auto Trait Implementations§

§

impl<'a, T, A> Freeze for Cloned<'a, T, A>
where A: Freeze,

§

impl<'a, T, A> RefUnwindSafe for Cloned<'a, T, A>

§

impl<'a, T, A> Unpin for Cloned<'a, T, A>
where A: Unpin,

§

impl<'a, T, A> UnwindSafe for Cloned<'a, T, A>

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<'a, T, C> IntoCloned<'a, T, C> for C
where T: Send + Sync + Clone + 'a, C: AtomicIter<&'a T>,

source§

fn cloned(self) -> Cloned<'a, T, C>

Converts this concurrent iterator over references into another concurrent iterator yielding clones of the elements.
source§

impl<'a, T, C> IntoCopied<'a, T, C> for C
where T: Send + Sync + Copy + 'a, C: AtomicIter<&'a T>,

source§

fn copied(self) -> Copied<'a, T, C>

Converts this concurrent iterator over references into another concurrent iterator yielding copies of the elements.
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.