ParIter

Struct ParIter 

Source
pub struct ParIter<'a, T: Sync> { /* private fields */ }
Expand description

Parallel iterator over slice references

Trait Implementations§

Source§

impl<'a, T: 'a + Sync> ParallelIterator for ParIter<'a, T>

Source§

type Item = &'a T

The type of item being iterated
Source§

fn for_each<F>(self, f: F)
where F: FnMut(Self::Item),

Execute a function on each item (sequential for now)
Source§

fn map<F, R>(self, f: F) -> Map<Self, F>
where F: Fn(Self::Item) -> R,

Map each item (sequential for now)
Source§

fn filter<F>(self, f: F) -> Filter<Self, F>
where F: Fn(&Self::Item) -> bool,

Filter items (sequential for now)
Source§

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

Collect into a collection
Source§

fn sum<S>(self) -> S
where S: Sum<&'a T>,

Sum all items
Source§

fn reduce<F>(self, reduce_op: F) -> Option<Self::Item>
where F: Fn(Self::Item, Self::Item) -> Self::Item,

Reduce items with a reduction function
Source§

fn find_any<F>(self, predicate: F) -> Option<Self::Item>
where F: Fn(&Self::Item) -> bool,

Find any item that matches the predicate
Source§

fn all<P>(self, predicate: P) -> bool
where P: Fn(Self::Item) -> bool,

Check if all items match the predicate
Source§

fn any<P>(self, predicate: P) -> bool
where P: Fn(Self::Item) -> bool,

Check if any item matches the predicate
Source§

fn count<F>(self, predicate: F) -> usize
where F: Fn(&Self::Item) -> bool,

Count items matching predicate
Source§

fn partition<F>(self, predicate: F) -> (Vec<Self::Item>, Vec<Self::Item>)
where F: Fn(&Self::Item) -> bool,

Partition items based on predicate
Source§

fn fold<T, ID, F>(self, identity: ID, fold_op: F) -> Fold<Self, ID, F>
where ID: Fn() -> T, F: Fn(T, Self::Item) -> T,

Fold items with an identity value and accumulator function
Source§

fn cloned<'a, T>(self) -> Cloned<Self>
where Self: ParallelIterator<Item = &'a T>, T: 'a + Clone,

Clone all items (for reference iterators)

Auto Trait Implementations§

§

impl<'a, T> Freeze for ParIter<'a, T>

§

impl<'a, T> RefUnwindSafe for ParIter<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for ParIter<'a, T>

§

impl<'a, T> Sync for ParIter<'a, T>

§

impl<'a, T> Unpin for ParIter<'a, T>

§

impl<'a, T> UnwindSafe for ParIter<'a, T>
where T: RefUnwindSafe,

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