pub struct ParIter<I, X, R = AdaptiveChunkRunner<DefaultPool>>{ /* private fields */ }Expand description
Parallel iterator.
Trait Implementations§
Source§impl<I, X, R> IntoIterator for ParIter<I, X, R>
impl<I, X, R> IntoIterator for ParIter<I, X, R>
Source§impl<I, X, R> Par for ParIter<I, X, R>
impl<I, X, R> Par for ParIter<I, X, R>
Source§fn runner<Q: ParRunner>(
self,
runner: Q,
) -> impl Par<Item = Self::Item, Xap = Self::Xap, Input = Self::Input>
fn runner<Q: ParRunner>( self, runner: Q, ) -> impl Par<Item = Self::Item, Xap = Self::Xap, Input = Self::Input>
Replaces the current parallel runner with
runner. Read moreSource§fn runner_with_diagnostics(
self,
) -> impl Par<Item = Self::Item, Xap = Self::Xap, Input = Self::Input>
fn runner_with_diagnostics( self, ) -> impl Par<Item = Self::Item, Xap = Self::Xap, Input = Self::Input>
Wraps the current parallel runner with a diagnostics-enabled runner. Read more
Source§fn num_threads(self, num_threads: impl Into<NumThreads>) -> Self
fn num_threads(self, num_threads: impl Into<NumThreads>) -> Self
Sets the maximum number of worker threads for this computation. Read more
Source§fn chunk_size(self, chunk_size: impl Into<ChunkSize>) -> Self
fn chunk_size(self, chunk_size: impl Into<ChunkSize>) -> Self
Sets chunk size used when pulling items from the concurrent input. Read more
Source§fn iteration_order(self, collect: IterationOrder) -> Self
fn iteration_order(self, collect: IterationOrder) -> Self
Sets iteration order semantics for operations sensitive to ordering. Read more
Source§fn map<Q, H>(
self,
h: H,
) -> impl Par<Item = Q, Xap = MapOf<Self::Xap, Q, H>, Input = Self::Input>
fn map<Q, H>( self, h: H, ) -> impl Par<Item = Q, Xap = MapOf<Self::Xap, Q, H>, Input = Self::Input>
Maps each element with closure
h. Read moreSource§fn inspect<H>(
self,
h: H,
) -> impl Par<Item = Self::Item, Xap = InsOf<Self::Xap, H>, Input = Self::Input>
fn inspect<H>( self, h: H, ) -> impl Par<Item = Self::Item, Xap = InsOf<Self::Xap, H>, Input = Self::Input>
Runs
h on each element and forwards the item unchanged. Read moreSource§fn filter<H>(
self,
h: H,
) -> impl Par<Item = Self::Item, Xap = FilOf<Self::Xap, H>, Input = Self::Input>
fn filter<H>( self, h: H, ) -> impl Par<Item = Self::Item, Xap = FilOf<Self::Xap, H>, Input = Self::Input>
Keeps only elements satisfying predicate
h. Read moreSource§fn filter_map<Q, H>(
self,
h: H,
) -> impl Par<Item = Q, Xap = FilMapOf<Self::Xap, Q, H>, Input = Self::Input>
fn filter_map<Q, H>( self, h: H, ) -> impl Par<Item = Q, Xap = FilMapOf<Self::Xap, Q, H>, Input = Self::Input>
Maps and filters in a single pass. Read more
Source§fn flat_map<V, H>(
self,
h: H,
) -> impl Par<Item = V::Item, Xap = FlatMapOf<Self::Xap, V, H>, Input = Self::Input>
fn flat_map<V, H>( self, h: H, ) -> impl Par<Item = V::Item, Xap = FlatMapOf<Self::Xap, V, H>, Input = Self::Input>
Maps each element to an iterator and flattens one level. Read more
Source§fn flatten(
self,
) -> impl Par<Item = <Self::Item as IntoIterator>::Item, Xap = FlattenOf<Self::Xap>, Input = Self::Input>where
Self::Item: IntoIterator,
fn flatten(
self,
) -> impl Par<Item = <Self::Item as IntoIterator>::Item, Xap = FlattenOf<Self::Xap>, Input = Self::Input>where
Self::Item: IntoIterator,
Flattens one level of nested iterables. Read more
Source§fn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Returns a lower and optional upper bound on the number of output items. Read more
Source§fn first(self) -> Option<X::O>
fn first(self) -> Option<X::O>
Returns the first item according to iteration order, or
None if empty. Read moreSource§fn reduce<F>(self, f: F) -> Option<X::O>
fn reduce<F>(self, f: F) -> Option<X::O>
Reduces items into one value using associative reducer
f. Read moreSource§fn collect_into<P>(self, dst: &mut P)
fn collect_into<P>(self, dst: &mut P)
Collects all items into
dst. Read moreSource§fn into_optional<T>(
self,
) -> impl ParOption<Elem = T, Xap1 = Self::Xap, M = T, Xap2 = Id<T>, Input = Self::Input, Size = <<Self::Xap as Xap>::Size as Size>::IntoPair>
fn into_optional<T>( self, ) -> impl ParOption<Elem = T, Xap1 = Self::Xap, M = T, Xap2 = Id<T>, Input = Self::Input, Size = <<Self::Xap as Xap>::Size as Size>::IntoPair>
Source§fn into_fallible<T, E>(
self,
) -> impl ParResult<Elem = T, Error = E, Xap1 = Self::Xap, M = T, Xap2 = Id<T>, Input = Self::Input, Size = <<Self::Xap as Xap>::Size as Size>::IntoPair>
fn into_fallible<T, E>( self, ) -> impl ParResult<Elem = T, Error = E, Xap1 = Self::Xap, M = T, Xap2 = Id<T>, Input = Self::Input, Size = <<Self::Xap as Xap>::Size as Size>::IntoPair>
Source§fn use_new<U, F>(
self,
f: F,
) -> impl ParUse<Item = Self::Item, Use = U, Xap = IdUse<Self::Xap, U>, Input = Self::Input>
fn use_new<U, F>( self, f: F, ) -> impl ParUse<Item = Self::Item, Use = U, Xap = IdUse<Self::Xap, U>, Input = Self::Input>
Creates one mutable
Use value per participating worker. Read moreSource§fn use_vec<U, F>(
self,
use_vec: &mut UseVec<U, F>,
) -> impl ParUse<Item = Self::Item, Use = U, Xap = IdUse<Self::Xap, U>, Input = Self::Input>
fn use_vec<U, F>( self, use_vec: &mut UseVec<U, F>, ) -> impl ParUse<Item = Self::Item, Use = U, Xap = IdUse<Self::Xap, U>, Input = Self::Input>
Source§fn use_slice<'a, U>(
self,
slice: &'a mut [U],
) -> impl ParUse<Item = Self::Item, Use = U, Xap = IdUse<Self::Xap, U>, Input = Self::Input>where
U: Send + 'a,
fn use_slice<'a, U>(
self,
slice: &'a mut [U],
) -> impl ParUse<Item = Self::Item, Use = U, Xap = IdUse<Self::Xap, U>, Input = Self::Input>where
U: Send + 'a,
Uses a caller-provided mutable slice as worker-local mutable state. Read more
Source§fn copied<'a, O>(
self,
) -> impl Par<Item = O, Xap = MappedOf<Self::Xap, FnCopied<'a, O>>, Input = Self::Input>
fn copied<'a, O>( self, ) -> impl Par<Item = O, Xap = MappedOf<Self::Xap, FnCopied<'a, O>>, Input = Self::Input>
Copies elements of a reference iterator. Read more
Source§fn cloned<'a, O>(
self,
) -> impl Par<Item = O, Xap = MappedOf<Self::Xap, FnCloned<'a, O>>, Input = Self::Input>
fn cloned<'a, O>( self, ) -> impl Par<Item = O, Xap = MappedOf<Self::Xap, FnCloned<'a, O>>, Input = Self::Input>
Clones elements of a reference iterator. Read more
Source§fn len(&self) -> usizewhere
Self::Input: ExactSizeConcurrentIter,
Self::Xap: Xap<Size = One>,
fn len(&self) -> usizewhere
Self::Input: ExactSizeConcurrentIter,
Self::Xap: Xap<Size = One>,
Returns the exact number of output items. Read more
Source§fn is_empty(&self) -> boolwhere
Self::Input: ExactSizeConcurrentIter,
Self::Xap: Xap<Size = One>,
fn is_empty(&self) -> boolwhere
Self::Input: ExactSizeConcurrentIter,
Self::Xap: Xap<Size = One>,
Returns
true when the parallel iterator has no output items. Read moreSource§fn fold<B, I, F>(self, init: I, f: F) -> Vec<B>
fn fold<B, I, F>(self, init: I, f: F) -> Vec<B>
Folds elements into per-thread accumulators and returns them. Read more
Source§fn max_by<F>(self, f: F) -> Option<Self::Item>
fn max_by<F>(self, f: F) -> Option<Self::Item>
Returns element considered maximum by comparator
f. Read moreSource§fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
Returns element with maximum key value. Read more
Source§fn min_by<F>(self, f: F) -> Option<Self::Item>
fn min_by<F>(self, f: F) -> Option<Self::Item>
Returns element considered minimum by comparator
f. Read moreAuto Trait Implementations§
impl<I, X, R> Freeze for ParIter<I, X, R>
impl<I, X, R> RefUnwindSafe for ParIter<I, X, R>
impl<I, X, R> Send for ParIter<I, X, R>
impl<I, X, R> Sync for ParIter<I, X, R>where
X: Sync,
impl<I, X, R> Unpin for ParIter<I, X, R>
impl<I, X, R> UnsafeUnpin for ParIter<I, X, R>
impl<I, X, R> UnwindSafe for ParIter<I, X, R>
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