pub struct ParallelForEachMut<V, F, I>{
pub iter: TaskQueue<I, V>,
pub f: F,
pub num_threads: usize,
pub v: PhantomData<V>,
}Expand description
ParallelForEachMut is a structure type that captures the information necessary to run a FnMut closure within the Iterator in parallel Its the result of parallel_task that can be run on any Iterator implementing type.
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));Fields§
§iter: TaskQueue<I, V>§f: F§num_threads: usize§v: PhantomData<V>Implementations§
Source§impl<I, V, F> ParallelForEachMut<V, F, I>
impl<I, V, F> ParallelForEachMut<V, F, I>
Auto Trait Implementations§
impl<V, F, I> Freeze for ParallelForEachMut<V, F, I>
impl<V, F, I> RefUnwindSafe for ParallelForEachMut<V, F, I>
impl<V, F, I> Send for ParallelForEachMut<V, F, I>where
F: Send,
impl<V, F, I> Sync for ParallelForEachMut<V, F, I>
impl<V, F, I> Unpin for ParallelForEachMut<V, F, I>
impl<V, F, I> UnwindSafe for ParallelForEachMut<V, F, I>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more