rayon::iter

Trait IntoParallelIterator

source
pub trait IntoParallelIterator {
    type Iter: ParallelIterator<Item = Self::Item>;
    type Item: Send;

    // 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<Item = Self::Item>

The parallel iterator type that will be created.

source

type Item: Send

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 rayon::prelude::*;

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

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

use rayon::prelude::*;

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

Implementations on Foreign Types§

source§

impl<'a, A> IntoParallelIterator for &'a (A,)

source§

impl<'a, A> IntoParallelIterator for &'a mut (A,)

source§

impl<'a, A, B> IntoParallelIterator for &'a (A, B)

source§

impl<'a, A, B> IntoParallelIterator for &'a mut (A, B)

source§

impl<'a, A, B, C> IntoParallelIterator for &'a (A, B, C)

source§

impl<'a, A, B, C> IntoParallelIterator for &'a mut (A, B, C)

source§

impl<'a, A, B, C, D> IntoParallelIterator for &'a (A, B, C, D)

source§

impl<'a, A, B, C, D> IntoParallelIterator for &'a mut (A, B, C, D)

source§

impl<'a, A, B, C, D, E> IntoParallelIterator for &'a (A, B, C, D, E)

source§

impl<'a, A, B, C, D, E> IntoParallelIterator for &'a mut (A, B, C, D, E)

source§

impl<'a, A, B, C, D, E, F> IntoParallelIterator for &'a (A, B, C, D, E, F)

source§

impl<'a, A, B, C, D, E, F> IntoParallelIterator for &'a mut (A, B, C, D, E, F)

source§

impl<'a, A, B, C, D, E, F, G> IntoParallelIterator for &'a (A, B, C, D, E, F, G)

source§

impl<'a, A, B, C, D, E, F, G> IntoParallelIterator for &'a mut (A, B, C, D, E, F, G)

source§

impl<'a, A, B, C, D, E, F, G, H> IntoParallelIterator for &'a (A, B, C, D, E, F, G, H)

source§

impl<'a, A, B, C, D, E, F, G, H> IntoParallelIterator for &'a mut (A, B, C, D, E, F, G, H)

source§

impl<'a, A, B, C, D, E, F, G, H, I> IntoParallelIterator for &'a (A, B, C, D, E, F, G, H, I)

source§

impl<'a, A, B, C, D, E, F, G, H, I> IntoParallelIterator for &'a mut (A, B, C, D, E, F, G, H, I)

source§

impl<'a, A, B, C, D, E, F, G, H, I, J> IntoParallelIterator for &'a (A, B, C, D, E, F, G, H, I, J)

source§

impl<'a, A, B, C, D, E, F, G, H, I, J> IntoParallelIterator for &'a mut (A, B, C, D, E, F, G, H, I, J)

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K> IntoParallelIterator for &'a (A, B, C, D, E, F, G, H, I, J, K)

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K> IntoParallelIterator for &'a mut (A, B, C, D, E, F, G, H, I, J, K)

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L> IntoParallelIterator for &'a (A, B, C, D, E, F, G, H, I, J, K, L)

source§

impl<'a, A, B, C, D, E, F, G, H, I, J, K, L> IntoParallelIterator for &'a mut (A, B, C, D, E, F, G, H, I, J, K, L)

source§

impl<'a, K: Ord + Sync, V: Send> IntoParallelIterator for &'a mut BTreeMap<K, V>

source§

type Item = <&'a mut BTreeMap<K, V> as IntoIterator>::Item

source§

type Iter = IterMut<'a, K, V>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'a, K: Ord + Sync, V: Sync> IntoParallelIterator for &'a BTreeMap<K, V>

source§

type Item = <&'a BTreeMap<K, V> as IntoIterator>::Item

source§

type Iter = Iter<'a, K, V>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'a, K: Hash + Eq + Sync, V: Send, S: BuildHasher> IntoParallelIterator for &'a mut HashMap<K, V, S>

source§

type Item = <&'a mut HashMap<K, V, S> as IntoIterator>::Item

source§

type Iter = IterMut<'a, K, V>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'a, K: Hash + Eq + Sync, V: Sync, S: BuildHasher> IntoParallelIterator for &'a HashMap<K, V, S>

source§

type Item = <&'a HashMap<K, V, S> as IntoIterator>::Item

source§

type Iter = Iter<'a, K, V>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'a, T: Ord + Sync> IntoParallelIterator for &'a BinaryHeap<T>

source§

type Item = <&'a BinaryHeap<T> as IntoIterator>::Item

source§

type Iter = Iter<'a, T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'a, T: Ord + Sync> IntoParallelIterator for &'a BTreeSet<T>

source§

type Item = <&'a BTreeSet<T> as IntoIterator>::Item

source§

type Iter = Iter<'a, T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'a, T: Hash + Eq + Sync, S: BuildHasher> IntoParallelIterator for &'a HashSet<T, S>

source§

type Item = <&'a HashSet<T, S> as IntoIterator>::Item

source§

type Iter = Iter<'a, T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'a, T: Send> IntoParallelIterator for &'a mut Option<T>

source§

impl<'a, T: Send> IntoParallelIterator for &'a mut LinkedList<T>

source§

type Item = <&'a mut LinkedList<T> as IntoIterator>::Item

source§

type Iter = IterMut<'a, T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'a, T: Send> IntoParallelIterator for &'a mut VecDeque<T>

source§

impl<'a, T: Send, E> IntoParallelIterator for &'a mut Result<T, E>

source§

impl<'a, T: Sync> IntoParallelIterator for &'a Option<T>

source§

type Item = &'a T

source§

type Iter = Iter<'a, T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'a, T: Sync> IntoParallelIterator for &'a LinkedList<T>

source§

type Item = <&'a LinkedList<T> as IntoIterator>::Item

source§

type Iter = Iter<'a, T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'a, T: Sync> IntoParallelIterator for &'a VecDeque<T>

source§

type Item = &'a T

source§

type Iter = Iter<'a, T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'a, T: Sync, E> IntoParallelIterator for &'a Result<T, E>

source§

type Item = &'a T

source§

type Iter = Iter<'a, T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'data, T: Send + 'data> IntoParallelIterator for &'data mut [T]

source§

impl<'data, T: Send + 'data> IntoParallelIterator for &'data mut Vec<T>

source§

impl<'data, T: Send + 'data, const N: usize> IntoParallelIterator for &'data mut [T; N]

source§

impl<'data, T: Sync + 'data> IntoParallelIterator for &'data [T]

source§

type Item = &'data T

source§

type Iter = Iter<'data, T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'data, T: Sync + 'data> IntoParallelIterator for &'data Vec<T>

source§

type Item = &'data T

source§

type Iter = Iter<'data, T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<'data, T: Sync + 'data, const N: usize> IntoParallelIterator for &'data [T; N]

source§

type Item = &'data T

source§

type Iter = Iter<'data, T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<A> IntoParallelIterator for (A,)

source§

impl<A, B> IntoParallelIterator for (A, B)

source§

impl<A, B, C> IntoParallelIterator for (A, B, C)

source§

impl<A, B, C, D> IntoParallelIterator for (A, B, C, D)

source§

impl<A, B, C, D, E> IntoParallelIterator for (A, B, C, D, E)

source§

impl<A, B, C, D, E, F> IntoParallelIterator for (A, B, C, D, E, F)

source§

impl<A, B, C, D, E, F, G> IntoParallelIterator for (A, B, C, D, E, F, G)

source§

impl<A, B, C, D, E, F, G, H> IntoParallelIterator for (A, B, C, D, E, F, G, H)

source§

impl<A, B, C, D, E, F, G, H, I> IntoParallelIterator for (A, B, C, D, E, F, G, H, I)

source§

impl<A, B, C, D, E, F, G, H, I, J> IntoParallelIterator for (A, B, C, D, E, F, G, H, I, J)

source§

impl<A, B, C, D, E, F, G, H, I, J, K> IntoParallelIterator for (A, B, C, D, E, F, G, H, I, J, K)

source§

impl<A, B, C, D, E, F, G, H, I, J, K, L> IntoParallelIterator for (A, B, C, D, E, F, G, H, I, J, K, L)

source§

impl<K: Ord + Send, V: Send> IntoParallelIterator for BTreeMap<K, V>

source§

type Item = <BTreeMap<K, V> as IntoIterator>::Item

source§

type Iter = IntoIter<K, V>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<K: Hash + Eq + Send, V: Send, S: BuildHasher> IntoParallelIterator for HashMap<K, V, S>

source§

type Item = <HashMap<K, V, S> as IntoIterator>::Item

source§

type Iter = IntoIter<K, V>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<T> IntoParallelIterator for Range<T>

Implemented for ranges of all primitive integer types and char.

source§

impl<T> IntoParallelIterator for RangeInclusive<T>

Implemented for ranges of all primitive integer types and char.

source§

impl<T: Ord + Send> IntoParallelIterator for BinaryHeap<T>

source§

type Item = T

source§

type Iter = IntoIter<T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<T: Ord + Send> IntoParallelIterator for BTreeSet<T>

source§

impl<T: Hash + Eq + Send, S: BuildHasher> IntoParallelIterator for HashSet<T, S>

source§

impl<T: Send> IntoParallelIterator for Option<T>

source§

type Item = T

source§

type Iter = IntoIter<T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<T: Send> IntoParallelIterator for LinkedList<T>

source§

impl<T: Send> IntoParallelIterator for VecDeque<T>

source§

type Item = T

source§

type Iter = IntoIter<T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<T: Send> IntoParallelIterator for Vec<T>

source§

type Item = T

source§

type Iter = IntoIter<T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<T: Send, E> IntoParallelIterator for Result<T, E>

source§

type Item = T

source§

type Iter = IntoIter<T>

source§

fn into_par_iter(self) -> Self::Iter

source§

impl<T: Send, const N: usize> IntoParallelIterator for [T; N]

source§

type Item = T

source§

type Iter = IntoIter<T, N>

source§

fn into_par_iter(self) -> Self::Iter

Implementors§