Skip to main content

IterIntoParIter

Trait IterIntoParIter 

Source
pub trait IterIntoParIter: Iterator {
    // Required method
    fn iter_into_par(self) -> ParIter<ConIterOfIter<Self>, Id<Self::Item>>
       where Self: Sized,
             Self::Item: Send;
}
Expand description

Converts a regular standard iterator into a parallel iterator.

Required Methods§

Source

fn iter_into_par(self) -> ParIter<ConIterOfIter<Self>, Id<Self::Item>>
where Self: Sized, Self::Item: Send,

Converts self into a parallel iterator.

§Example
use orx_parallel::*;

let sum: i32 = (0..10)
    .into_iter()
    .iter_into_par()
    .map(|x| x * 2)
    .sum();

assert_eq!(sum, 90);

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<I> IterIntoParIter for I
where I: Iterator, I::Item: Send + Sync,