pub fn parallel_scan<T, U, F>(
input: &[T],
chunk_count: usize,
worker: F,
) -> Vec<U>Expand description
Execute worker across input in parallel using
chunk_count threads. Preserves input order in the
output: chunk 0’s results come first, chunk 1’s next, etc.
T— the input row type. Must beSend + Syncso chunks can be passed to worker threads.U— the output row type from a single worker. Must beSend.F— the worker closure. Must beSend + Sync + 'staticand take a slice reference to the chunk.
Falls back to sequential execution when the input is
smaller than MIN_PARALLEL_ROWS or when chunk_count <= 1.