Skip to main content

IntoParIter

Trait IntoParIter 

Source
pub trait IntoParIter: IntoConcurrentIter {
    // Required method
    fn into_par(self) -> ParIter<Self::IntoIter, Id<Self::Item>>;
}
Expand description

Converts values into a parallel iterator.

Sequential counterpart: IntoIterator::into_iter.

Required Methods§

Source

fn into_par(self) -> ParIter<Self::IntoIter, Id<Self::Item>>

Consumes self and returns a parallel iterator over its items.

§Example
use orx_parallel::*;

let sum: i32 = vec![1, 2, 3, 4]
    .into_par()
    .map(|x| x * 2)
    .sum();

assert_eq!(sum, 20);

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§