[][src]Trait asparit::IntoParallelIterator

pub trait IntoParallelIterator<'a> {
    type Iter: ParallelIterator<'a, Item = Self::Item>;
    type Item: Send + 'a;
    pub fn into_par_iter(self) -> Self::Iter;
}

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.

Associated Types

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

The parallel iterator type that will be created.

type Item: Send + 'a

The type of item that the parallel iterator will produce.

Loading content...

Required methods

pub 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)]);
Loading content...

Implementations on Foreign Types

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

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

type Item = I

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

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

type Item = &'a I

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

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

type Item = I

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

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

type Item = &'a I

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

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

type Iter = Iter<T>

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

type Iter = Iter<'a, T>

type Item = &'a T

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

type Iter = IterMut<'a, T>

type Item = &'a mut T

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

type Iter = Iter<'a, T>

type Item = &'a T

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

type Iter = IterMut<'a, T>

type Item = &'a mut T

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

type Item = T

type Iter = IntoIter<T>

Loading content...

Implementors

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

type Iter = T

type Item = T::Item

Loading content...