Expand description
Parallel iteration abstraction for WASM compatibility.
This module provides conditional parallel/sequential iteration based on
the parallel feature flag. On native targets with the parallel feature,
uses rayon for multi-threaded execution. On WASM or without the feature,
falls back to sequential iteration.
§Usage
Use the iter_maybe_parallel! macro to conditionally parallelize iteration:
ⓘ
use crate::parallel::iter_maybe_parallel;
let results: Vec<_> = iter_maybe_parallel!((0..n))
.map(|i| expensive_computation(i))
.collect();Macros§
- iter_
maybe_ parallel - Macro for conditionally parallel iteration over ranges.
- maybe_
par_ chunks_ mut - Macro for parallel/sequential chunks iteration on mutable slices.
- maybe_
par_ chunks_ mut_ enumerate - Macro for enumerated parallel/sequential chunks iteration.
- slice_
maybe_ parallel - Macro for conditionally parallel reference iteration over slices.
- slice_
maybe_ parallel_ mut - Macro for conditionally parallel mutable iteration over slices.