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]

This implementation requires const generics, stabilized in Rust 1.51.

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]

This implementation requires const generics, stabilized in Rust 1.51.

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]

This implementation requires const generics, stabilized in Rust 1.51.

Source§

type Item = T

Source§

type Iter = IntoIter<T, N>

Source§

fn into_par_iter(self) -> Self::Iter

Implementors§