pub fn for_each<I, F, T>(i: I, f: F)Expand description
Calls the closure on each element of the iterator in parallel, waiting for all closures to finish.
- The closure does not require
'staticlifetime since thefor_eachfunction bounds the lifetime of all submitted closures. - The closure must be
Syncas multiple threads will refer to it. - The iterator items must be
Sendas they will be sent from one thread to another.