Struct Iter
pub struct Iter<T> { /* private fields */ }
Parallel iterator over a range, implemented for all integer types and char.
Note: The zip operation requires IndexedParallelIterator
which is not implemented for u64, i64, u128, or i128.
use rayon::prelude::*;
let p = (0..25usize).into_par_iter()
.zip(0..25usize)
.filter(|&(x, y)| x % 5 == 0 || y % 5 == 0)
.map(|(x, y)| x * y)
.sum::<usize>();
let s = (0..25usize).zip(0..25)
.filter(|&(x, y)| x % 5 == 0 || y % 5 == 0)
.map(|(x, y)| x * y)
.sum();
assert_eq!(p, s);
Trait Implementations
impl IndexedParallelIterator for Iter<char>
fn drive<C>(self, consumer: C) -> C::Result where C: Consumer<Self::Item>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<Self::Item>,
impl ParallelIterator for Iter<char>
type Item = char;fn drive_unindexed<C>(self, consumer: C) -> C::Result where C: UnindexedConsumer<Self::Item>,fn opt_len(&self) -> Option<usize>
impl<T: Clone> Clone for Iter<T>
fn clone(&self) -> Self
impl<T: Debug> Debug for Iter<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<T: IndexedRangeInteger> IndexedParallelIterator for Iter<T>
fn drive<C>(self, consumer: C) -> C::Result where C: Consumer<T>,fn len(&self) -> usizefn with_producer<CB>(self, callback: CB) -> CB::Output where CB: ProducerCallback<T>,
impl<T: RangeInteger> ParallelIterator for Iter<T>
type Item = T;fn drive_unindexed<C>(self, consumer: C) -> C::Result where C: UnindexedConsumer<T>,fn opt_len(&self) -> Option<usize>