Skip to main content

parallel_map

Function parallel_map 

Source
pub fn parallel_map<T, R, F>(items: &[T], func: F) -> Result<Vec<R>>
where T: Sync, R: Send, F: Fn(&T) -> Result<R> + Sync + Send,
Expand description

Parallel map operation

A simpler version that just returns all results or the first error.

§Arguments

  • items - Items to process
  • func - Function to apply to each item

§Returns

Vector of results

§Errors

Returns the first error encountered