ParallelMapIter

Trait ParallelMapIter 

Source
pub trait ParallelMapIter<I, V, F, T>
where Self: AtomicIterator<AtomicItem = V> + Send + Sized, F: Fn(V) -> T + Send + Sync, V: Send + Sync, T: Send + Sync,
{ // Provided method fn map(self, f: F) -> ParallelMap<V, F, T, Self> { ... } }
Expand description

ParallelMapIter allows calling the .map(f) on type implementing AtomicIterator to get a ParallelMap object on which collect may be called.

use parallel_task::prelude::*;
 
let res = (0..100_000).collect::<Vec<i32>>().parallel_iter().map(|val|*val).collect::<Vec<i32>>();
assert_eq!(res.len(),100_000)

Provided Methods§

Source

fn map(self, f: F) -> ParallelMap<V, F, T, Self>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<I, V, F, T> ParallelMapIter<I, V, F, T> for I
where I: AtomicIterator<AtomicItem = V> + Send + Sized, F: Fn(V) -> T + Send + Sync, V: Send + Sync, T: Send + Sync,