pub struct Par<I, R = FixedChunkRunner>{ /* private fields */ }
Expand description

A parallel iterator.

Trait Implementations§

Source§

impl<I, R> ParIter<R> for Par<I, R>

Source§

type Item = <I as ConcurrentIter>::Item

Element type of the parallel iterator.
Source§

fn con_iter(&self) -> &impl ConcurrentIter

Returns a reference to the input concurrent iterator.
Source§

fn params(&self) -> &Params

Parameters of the parallel iterator. Read more
Source§

fn num_threads(self, num_threads: impl Into<NumThreads>) -> Par<I, R>

Sets the number of threads to be used in the parallel execution. Integers can be used as the argument with the following mapping: Read more
Source§

fn chunk_size(self, chunk_size: impl Into<ChunkSize>) -> Par<I, R>

Sets the number of elements to be pulled from the concurrent iterator during the parallel execution. When integers are used as argument, the following mapping applies: Read more
Source§

fn iteration_order(self, collect: IterationOrder) -> Par<I, R>

Sets the iteration order of the parallel computation. Read more
Source§

fn with_runner<Q>( self, ) -> impl ParIter<Q, Item = <Par<I, R> as ParIter<R>>::Item>
where Q: ParallelRunner,

Rather than the DefaultRunner, uses the parallel runner Q which implements ParallelRunner. Read more
Source§

fn map<Out, Map>(self, map: Map) -> impl ParIter<R, Item = Out>
where Out: Send + Sync, Map: Fn(<Par<I, R> as ParIter<R>>::Item) -> Out + Send + Sync + Clone,

Takes a closure map and creates a parallel iterator which calls that closure on each element. Read more
Source§

fn filter<Filter>( self, filter: Filter, ) -> impl ParIter<R, Item = <Par<I, R> as ParIter<R>>::Item>
where Filter: Fn(&<Par<I, R> as ParIter<R>>::Item) -> bool + Send + Sync,

Creates an iterator which uses a closure filter to determine if an element should be yielded. Read more
Source§

fn flat_map<IOut, FlatMap>( self, flat_map: FlatMap, ) -> impl ParIter<R, Item = <IOut as IntoIterator>::Item>
where IOut: IntoIterator + Send + Sync, <IOut as IntoIterator>::IntoIter: Send + Sync, <IOut as IntoIterator>::Item: Send + Sync, FlatMap: Fn(<Par<I, R> as ParIter<R>>::Item) -> IOut + Send + Sync,

Creates an iterator that works like map, but flattens nested structure. Read more
Source§

fn filter_map<Out, FilterMap>( self, filter_map: FilterMap, ) -> impl ParIter<R, Item = Out>
where Out: Send + Sync, FilterMap: Fn(<Par<I, R> as ParIter<R>>::Item) -> Option<Out> + Send + Sync + Clone,

Creates an iterator that both filters and maps. Read more
Source§

fn collect_into<C>(self, output: C) -> C
where C: ParCollectInto<<Par<I, R> as ParIter<R>>::Item>,

Collects all the items from an iterator into a collection. Read more
Source§

fn reduce<Reduce>( self, reduce: Reduce, ) -> Option<<Par<I, R> as ParIter<R>>::Item>
where Reduce: Fn(<Par<I, R> as ParIter<R>>::Item, <Par<I, R> as ParIter<R>>::Item) -> <Par<I, R> as ParIter<R>>::Item + Send + Sync,

Reduces the elements to a single one, by repeatedly applying a reducing operation. Read more
Source§

fn first(self) -> Option<<Par<I, R> as ParIter<R>>::Item>

Returns the first (or any) element of the iterator; returns None if it is empty. Read more
Source§

fn inspect<Operation>( self, operation: Operation, ) -> impl ParIter<R, Item = Self::Item>
where Operation: Fn(&Self::Item) + Sync + Send + Clone,

Does something with each element of an iterator, passing the value on. Read more
Source§

fn copied<'a, T>(self) -> impl ParIter<R, Item = T>
where T: 'a + Copy + Send + Sync, Self: ParIter<R, Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
Source§

fn cloned<'a, T>(self) -> impl ParIter<R, Item = T>
where T: 'a + Clone + Send + Sync, Self: ParIter<R, Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
Source§

fn flatten(self) -> impl ParIter<R, Item = <Self::Item as IntoIterator>::Item>
where Self::Item: IntoIterator, <Self::Item as IntoIterator>::IntoIter: Send + Sync, <Self::Item as IntoIterator>::Item: Send + Sync, R: Send + Sync, Self: Send + Sync,

Creates an iterator that flattens nested structure. Read more
Source§

fn collect<C>(self) -> C
where C: ParCollectInto<Self::Item>,

Transforms an iterator into a collection. Read more
Source§

fn all<Predicate>(self, predicate: Predicate) -> bool
where Predicate: Fn(&Self::Item) -> bool + Send + Sync + Clone,

Tests if every element of the iterator matches a predicate. Read more
Source§

fn any<Predicate>(self, predicate: Predicate) -> bool
where Predicate: Fn(&Self::Item) -> bool + Send + Sync + Clone,

Tests if any element of the iterator matches a predicate. Read more
Source§

fn count(self) -> usize

Consumes the iterator, counting the number of iterations and returning it. Read more
Source§

fn for_each<Operation>(self, operation: Operation)
where Operation: Fn(Self::Item) + Sync + Send,

Calls a closure on each element of an iterator. Read more
Source§

fn max(self) -> Option<Self::Item>
where Self::Item: Ord,

Returns the maximum element of an iterator. Read more
Source§

fn max_by<Compare>(self, compare: Compare) -> Option<Self::Item>
where Compare: Fn(&Self::Item, &Self::Item) -> Ordering + Sync,

Returns the element that gives the maximum value with respect to the specified compare function. Read more
Source§

fn max_by_key<Key, GetKey>(self, key: GetKey) -> Option<Self::Item>
where Key: Ord, GetKey: Fn(&Self::Item) -> Key + Sync,

Returns the element that gives the maximum value from the specified function. Read more
Source§

fn min(self) -> Option<Self::Item>
where Self::Item: Ord,

Returns the minimum element of an iterator. Read more
Source§

fn min_by<Compare>(self, compare: Compare) -> Option<Self::Item>
where Compare: Fn(&Self::Item, &Self::Item) -> Ordering + Sync,

Returns the element that gives the minimum value with respect to the specified compare function. Read more
Source§

fn min_by_key<Key, GetKey>(self, get_key: GetKey) -> Option<Self::Item>
where Key: Ord, GetKey: Fn(&Self::Item) -> Key + Sync,

Returns the element that gives the minimum value from the specified function. Read more
Source§

fn sum<Out>(self) -> Out
where Self::Item: Sum<Out>, Out: Send + Sync,

Sums the elements of an iterator. Read more
Source§

fn find<Predicate>(self, predicate: Predicate) -> Option<Self::Item>
where Predicate: Fn(&Self::Item) -> bool + Send + Sync + Clone,

Searches for an element of an iterator that satisfies a predicate. Read more
Source§

impl<I, R> Send for Par<I, R>

Source§

impl<I, R> Sync for Par<I, R>

Auto Trait Implementations§

§

impl<I, R> Freeze for Par<I, R>
where I: Freeze,

§

impl<I, R> RefUnwindSafe for Par<I, R>

§

impl<I, R> Unpin for Par<I, R>
where I: Unpin, R: Unpin,

§

impl<I, R> UnwindSafe for Par<I, R>
where I: UnwindSafe, R: 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> SoM<T> for T

Source§

fn get_ref(&self) -> &T

Returns a reference to self.
Source§

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

Returns a mutable reference to self.
Source§

impl<T> SoR<T> for T

Source§

fn get_ref(&self) -> &T

Returns a reference to self.
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.