Skip to main content

run

Function run 

Source
pub fn run<T, A, E, F>(
    work: &[T],
    threads: usize,
    run: &F,
) -> Result<Vec<(A, Duration)>, E>
where T: Sync, A: Send, E: Send, F: Fn(&T) -> Result<A, E> + Sync,
Expand description

Runs run on every item of work on threads threads (at least one, and no more than there are items): thread w takes items w, w + threads, w + 2 × threads, …, and times each. The answers come back in work’s order with their times, or the first error in that order, whatever the thread count: once an item fails, no thread starts a later one, but the earlier ones all run. A panic in run is resumed here, on the calling thread.