IntoParallelIterator

Trait IntoParallelIterator 

Source
pub trait IntoParallelIterator<'a> {
    type Iter: ParallelIterator<'a, Item = Self::Item>;
    type Item: Send + 'a;

    // Required method
    fn into_par_iter(self) -> Self::Iter;
}
Expand description

IntoParallelIterator implements the conversion to a ParallelIterator.

By implementing IntoParallelIterator for a type, you define how it will transformed into an iterator. This is a parallel version of the standard library’s std::iter::IntoIterator trait.

Required Associated Types§

Source

type Iter: ParallelIterator<'a, Item = Self::Item>

The parallel iterator type that will be created.

Source

type Item: Send + 'a

The type of item that the parallel iterator will produce.

Required Methods§

Source

fn into_par_iter(self) -> Self::Iter

Converts self into a parallel iterator.

§Examples
use asparit::*;

println!("counting in parallel:");
(0..100)
    .into_par_iter()
    .for_each(|i| println!("{}", i))
    .exec();

This conversion is often implicit for arguments to methods like zip.

use asparit::*;

let v: Vec<_> = (0..5).into_par_iter().zip(5..10).collect().exec();
assert_eq!(v, [(0, 5), (1, 6), (2, 7), (3, 8), (4, 9)]);

Implementations on Foreign Types§

Source§

impl<'a, I> IntoParallelIterator<'a> for &'a BinaryHeap<I>
where I: Send + Sync + 'a,

Source§

impl<'a, I> IntoParallelIterator<'a> for BinaryHeap<I>
where I: Send + 'a,

Source§

type Iter = <Vec<I> as IntoParallelIterator<'a>>::Iter

Source§

type Item = I

Source§

fn into_par_iter(self) -> Self::Iter

Source§

impl<'a, I, S> IntoParallelIterator<'a> for &'a HashSet<I, S>
where I: Send + Sync + 'a, S: BuildHasher,

Source§

impl<'a, I, S> IntoParallelIterator<'a> for HashSet<I, S>
where I: Send + 'a, S: BuildHasher,

Source§

type Iter = <Vec<I> as IntoParallelIterator<'a>>::Iter

Source§

type Item = I

Source§

fn into_par_iter(self) -> Self::Iter

Source§

impl<'a, T> IntoParallelIterator<'a> for &'a [T]
where T: Send + Sync,

Source§

type Iter = Iter<'a, T>

Source§

type Item = &'a T

Source§

fn into_par_iter(self) -> Self::Iter

Source§

impl<'a, T> IntoParallelIterator<'a> for &'a Vec<T>
where T: Send + Sync,

Source§

type Iter = Iter<'a, T>

Source§

type Item = &'a T

Source§

fn into_par_iter(self) -> Self::Iter

Source§

impl<'a, T> IntoParallelIterator<'a> for &'a mut [T]
where T: Send + Sync,

Source§

type Iter = IterMut<'a, T>

Source§

type Item = &'a mut T

Source§

fn into_par_iter(self) -> Self::Iter

Source§

impl<'a, T> IntoParallelIterator<'a> for &'a mut Vec<T>
where T: Send + Sync,

Source§

type Iter = IterMut<'a, T>

Source§

type Item = &'a mut T

Source§

fn into_par_iter(self) -> Self::Iter

Source§

impl<'a, T> IntoParallelIterator<'a> for Vec<T>
where T: Send + 'a,

Source§

type Item = T

Source§

type Iter = IntoIter<T>

Source§

fn into_par_iter(self) -> Self::Iter

Source§

impl<'a, T> IntoParallelIterator<'a> for Range<T>
where Iter<T>: ParallelIterator<'a>,

Source§

type Item = <Iter<T> as ParallelIterator<'a>>::Item

Source§

type Iter = Iter<T>

Source§

fn into_par_iter(self) -> Self::Iter

Implementors§

Source§

impl<'a, T> IntoParallelIterator<'a> for T
where T: ParallelIterator<'a>,

Source§

type Iter = T

Source§

type Item = <T as ParallelIterator<'a>>::Item