Skip to main content

ParRecIter

Struct ParRecIter 

Source
pub struct ParRecIter<I, X, Ix, Ex, R = AdaptiveChunkRunner<DefaultPool>>
where I: IntoIterator, X: Xap<I = I::Item>, R: ParRunner, Ix: IntoIterator<Item = X::I>, Ex: Fn(&I::Item) -> Ix + Send + Copy,
{ /* private fields */ }
Expand description

Parallel iterator.

Trait Implementations§

Source§

impl<I, X, Ix, Ex, R> ParRec for ParRecIter<I, X, Ix, Ex, R>
where I: IntoIterator, X: Xap<I = I::Item>, R: ParRunner, Ix: IntoIterator<Item = X::I>, Ex: Fn(&I::Item) -> Ix + Send + Copy,

Source§

fn runner<Q: ParRunner>( self, runner: Q, ) -> impl ParRec<Item = Self::Item, Xap = Self::Xap, Input = Self::Input>

Replaces the current parallel runner with runner. Read more
Source§

fn runner_with_diagnostics( self, ) -> impl ParRec<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

Sets the maximum number of worker threads for this computation. Read more
Source§

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

Sets iteration order semantics for operations sensitive to ordering. Read more
Source§

fn map<Q, H>( self, h: H, ) -> impl ParRec<Item = Q, Xap = MapOf<Self::Xap, Q, H>, Input = Self::Input>
where H: Fn(Self::Item) -> Q + Copy + Send,

Maps each element with closure h. Read more
Source§

fn inspect<H>( self, h: H, ) -> impl ParRec<Item = Self::Item, Xap = InsOf<Self::Xap, H>, Input = Self::Input>
where H: Fn(&Self::Item) + Copy + Send,

Runs h on each element and forwards the item unchanged. Read more
Source§

fn filter<H>( self, h: H, ) -> impl ParRec<Item = Self::Item, Xap = FilOf<Self::Xap, H>, Input = Self::Input>
where H: Fn(&Self::Item) -> bool + Copy + Send,

Keeps only elements satisfying predicate h. Read more
Source§

fn filter_map<Q, H>( self, h: H, ) -> impl ParRec<Item = Q, Xap = FilMapOf<Self::Xap, Q, H>, Input = Self::Input>
where H: Fn(Self::Item) -> Option<Q> + Copy + Send,

Maps and filters in a single pass. Read more
Source§

fn flat_map<V, H>( self, h: H, ) -> impl ParRec<Item = V::Item, Xap = FlatMapOf<Self::Xap, V, H>, Input = Self::Input>
where V: IntoIterator, H: Fn(Self::Item) -> V + Copy + Send,

Maps each element to an iterator and flattens one level. Read more
Source§

fn flatten( self, ) -> impl ParRec<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 first(self) -> Option<Self::Item>
where Self::Item: Send, <Self::Input as IntoIterator>::Item: Send,

Returns an item, or None if empty. Read more
Source§

fn reduce<F>(self, f: F) -> Option<Self::Item>
where F: Fn(Self::Item, Self::Item) -> Self::Item + Send + Copy, Self::Item: Send, <Self::Input as IntoIterator>::Item: Send,

Reduces items into one value using associative reducer f. Read more
Source§

fn fold<B, Id, F>(self, init: Id, f: F) -> Vec<B>
where B: Send, Id: Fn() -> B, F: Fn(&mut B, Self::Item) + Copy + Send, <Self::Input as IntoIterator>::Item: Send,

Folds elements into per-thread accumulators and returns them. Read more
Source§

fn collect_into<C>(self, dst: &mut C)
where C: ParExtend<Self::Item>, Self::Item: Send, <Self::Input as IntoIterator>::Item: Send,

Collects all items into dst. Read more
Source§

fn collect<P>(self) -> P
where P: ParExtend<Self::Item> + Default, Self::Item: Send, <Self::Input as IntoIterator>::Item: Send,

Collects all items into a new collection. Read more
Source§

fn all<F>(self, f: F) -> bool
where F: Fn(&Self::Item) -> bool + Copy + Send, <Self::Input as IntoIterator>::Item: Send,

Returns true if all items satisfy predicate f. Read more
Source§

fn any<F>(self, f: F) -> bool
where F: Fn(&Self::Item) -> bool + Copy + Send, <Self::Input as IntoIterator>::Item: Send,

Returns true if any item satisfies predicate f. Read more
Source§

fn count(self) -> usize
where <Self::Input as IntoIterator>::Item: Send,

Counts elements. Read more
Source§

fn find<F>(self, f: F) -> Option<Self::Item>
where Self::Item: Send, F: Fn(&Self::Item) -> bool + Copy + Send, <Self::Input as IntoIterator>::Item: Send,

Finds the first item satisfying predicate f, or None if none match. Read more
Source§

fn for_each<F>(self, f: F)
where F: Fn(Self::Item) + Send + Copy, <Self::Input as IntoIterator>::Item: Send,

Executes f for each item. Read more
Source§

fn max(self) -> Option<Self::Item>
where Self::Item: Ord + Send, <Self::Input as IntoIterator>::Item: Send,

Returns maximum element, or None if empty. Read more
Source§

fn max_by<F>(self, f: F) -> Option<Self::Item>
where Self::Item: Send, F: Fn(&Self::Item, &Self::Item) -> Ordering + Copy + Send, <Self::Input as IntoIterator>::Item: Send,

Returns element considered maximum by comparator f. Read more
Source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where Self::Item: Send, B: Ord, F: Fn(&Self::Item) -> B + Copy + Send, <Self::Input as IntoIterator>::Item: Send,

Returns element with maximum key value. Read more
Source§

fn min(self) -> Option<Self::Item>
where Self::Item: Ord + Send, <Self::Input as IntoIterator>::Item: Send,

Returns minimum element, or None if empty. Read more
Source§

fn min_by<F>(self, f: F) -> Option<Self::Item>
where Self::Item: Send, F: Fn(&Self::Item, &Self::Item) -> Ordering + Copy + Send, <Self::Input as IntoIterator>::Item: Send,

Returns element considered minimum by comparator f. Read more
Source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where Self::Item: Send, B: Ord, F: Fn(&Self::Item) -> B + Copy + Send, <Self::Input as IntoIterator>::Item: Send,

Returns element with minimum key value. Read more
Source§

fn sum<S>(self) -> S
where Self::Item: Sum<S>, S: Send, <Self::Input as IntoIterator>::Item: Send,

Sums elements using Sum implementation of the item type. Read more

Auto Trait Implementations§

§

impl<I, X, Ix, Ex, R> Freeze for ParRecIter<I, X, Ix, Ex, R>
where I: Freeze, X: Freeze, R: Freeze, Ex: Freeze,

§

impl<I, X, Ix, Ex, R> RefUnwindSafe for ParRecIter<I, X, Ix, Ex, R>

§

impl<I, X, Ix, Ex, R> Send for ParRecIter<I, X, Ix, Ex, R>
where I: Send, R: Send,

§

impl<I, X, Ix, Ex, R> Sync for ParRecIter<I, X, Ix, Ex, R>
where I: Sync, X: Sync, Ex: Sync,

§

impl<I, X, Ix, Ex, R> Unpin for ParRecIter<I, X, Ix, Ex, R>
where I: Unpin, X: Unpin, R: Unpin, Ex: Unpin,

§

impl<I, X, Ix, Ex, R> UnsafeUnpin for ParRecIter<I, X, Ix, Ex, R>

§

impl<I, X, Ix, Ex, R> UnwindSafe for ParRecIter<I, X, Ix, Ex, R>

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.