ParallelForEachMutIter

Trait ParallelForEachMutIter 

Source
pub trait ParallelForEachMutIter<I, V, F>
where Self: AtomicIterator<AtomicItem = V> + Send + Sized, F: FnMut(V) + Send, V: Send,
{ // Provided method fn for_each_mut(self, f: F) { ... } }
Expand description

ParallelForEachMutIter allows calling the .for_each_mut(f) to run a FnMut function on type implementing AtomicIterator. FnMut in a parallel computation does not add any value. This has been added only for completion purposes.

 use parallel_task::{for_each_mut::ParallelForEachMutIter, prelude::*};
 
 let mut test = 0;
 let target = 100;
 (0..=target).collect::<Vec<i32>>().
 parallel_iter().for_each_mut(|v| { test += v;});
 assert_eq!(test, (target * (target + 1)/2));

Provided Methods§

Source

fn for_each_mut(self, f: F)

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> ParallelForEachMutIter<I, V, F> for I
where I: AtomicIterator<AtomicItem = V> + Send + Sized, F: FnMut(V) + Send, V: Send,