Struct orx_concurrent_iter::ConIterOfRange

source ·
pub struct ConIterOfRange<Idx>
where Idx: Send + Sync + Clone + Copy + From<usize> + Into<usize> + Add<Idx, Output = Idx> + Sub<Idx, Output = Idx> + Ord,
{ /* private fields */ }
Expand description

A concurrent iterator over a slice yielding references to the elements.

Implementations§

source§

impl<Idx> ConIterOfRange<Idx>
where Idx: Send + Sync + Clone + Copy + From<usize> + Into<usize> + Add<Idx, Output = Idx> + Sub<Idx, Output = Idx> + Ord,

source

pub fn new(range: Range<Idx>) -> Self

Creates a concurrent iterator for the given range.

Trait Implementations§

source§

impl<Idx> AtomicIter<Idx> for ConIterOfRange<Idx>
where Idx: Send + Sync + Clone + Copy + From<usize> + Into<usize> + Add<Idx, Output = Idx> + Sub<Idx, Output = Idx> + Ord,

source§

fn counter(&self) -> &AtomicCounter

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

fn get(&self, item_idx: usize) -> Option<Idx>

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<Idx>

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(Idx)>(&self, chunk_size: usize, f: F)

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

fn enumerate_for_each_n<F: FnMut(usize, Idx)>(&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 more
source§

fn fold<B, F: FnMut(B, Idx) -> B>( &self, chunk_size: usize, initial: B, f: F ) -> B

Folds the elements of the iterator pulled concurrently using fold function. 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<Idx> AtomicIterWithInitialLen<Idx> for ConIterOfRange<Idx>
where Idx: Send + Sync + Clone + Copy + From<usize> + Into<usize> + Add<Idx, Output = Idx> + Sub<Idx, Output = Idx> + Ord,

source§

fn initial_len(&self) -> usize

Returns the initial length of the atomic iterator.
source§

fn fetch_n_with_exact_len( &self, n: usize ) -> NextManyExact<Idx, impl ExactSizeIterator<Item = Idx>>

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<Idx> Clone for ConIterOfRange<Idx>
where Idx: Send + Sync + Clone + Copy + From<usize> + Into<usize> + Add<Idx, Output = Idx> + Sub<Idx, Output = Idx> + Ord + Clone,

source§

fn clone(&self) -> ConIterOfRange<Idx>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Idx> ConcurrentIter for ConIterOfRange<Idx>
where Idx: Send + Sync + Clone + Copy + From<usize> + Into<usize> + Add<Idx, Output = Idx> + Sub<Idx, Output = Idx> + Ord,

§

type Item = Idx

Type of the items that the iterator yields.
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) -> 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 more
source§

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

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

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

Folds the elements of the iterator pulled concurrently using fold function. Read more
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, fun: Fun)

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

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

Applies the function fun to each index and corresponding element of the iterator concurrently. It may be considered as the concurrent counterpart of the chain of enumerate and for_each calls. Read more
source§

impl<Idx> Debug for ConIterOfRange<Idx>
where Idx: Send + Sync + Clone + Copy + From<usize> + Into<usize> + Add<Idx, Output = Idx> + Sub<Idx, Output = Idx> + Ord + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Idx> ExactSizeConcurrentIter for ConIterOfRange<Idx>
where Idx: Send + Sync + Clone + Copy + From<usize> + Into<usize> + Add<Idx, Output = Idx> + Sub<Idx, Output = Idx> + Ord,

source§

fn len(&self) -> usize

Returns the exact remaining length of the concurrent iterator.
source§

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

fn is_empty(&self) -> bool

Returns true if the iterator is empty.
source§

impl<Idx> From<Range<Idx>> for ConIterOfRange<Idx>
where Idx: Send + Sync + Clone + Copy + From<usize> + Into<usize> + Add<Idx, Output = Idx> + Sub<Idx, Output = Idx> + Ord,

source§

fn from(range: Range<Idx>) -> Self

Creates a concurrent iterator for the given range.

source§

impl<Idx> Send for ConIterOfRange<Idx>
where Idx: Send + Sync + Clone + Copy + From<usize> + Into<usize> + Add<Idx, Output = Idx> + Sub<Idx, Output = Idx> + Ord,

source§

impl<Idx> Sync for ConIterOfRange<Idx>
where Idx: Send + Sync + Clone + Copy + From<usize> + Into<usize> + Add<Idx, Output = Idx> + Sub<Idx, Output = Idx> + Ord,

Auto Trait Implementations§

§

impl<Idx> !Freeze for ConIterOfRange<Idx>

§

impl<Idx> RefUnwindSafe for ConIterOfRange<Idx>
where Idx: RefUnwindSafe,

§

impl<Idx> Unpin for ConIterOfRange<Idx>
where Idx: Unpin,

§

impl<Idx> UnwindSafe for ConIterOfRange<Idx>
where Idx: UnwindSafe,

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.