moirai-iter
Iterator combinators for the Moirai concurrency library. One iterator type abstracts over three execution contexts:
- Parallel — CPU-bound work across worker threads with work stealing.
- Async — I/O-bound work through async/await.
- Hybrid — mixed workloads, the default for
moirai_iter.
map and filter are synchronous adapters; collect, reduce, and for_each
are async and must be awaited. Async-closure variants (map_async,
filter_async, for_each_async) take a future-returning closure.
[]
= "0.5"
use ;
async
Also exports the Rayon-style ParallelIterator / IndexedParallelIterator
surface, par_range / async_range, and the ExecutionContext /
ExecutionStrategy types.
Standalone nested workload
The bounded nested_stress example runs the nested parallel workload outside
the libtest harness, which keeps the process shape available for diagnostics:
cargo run --locked --release -p moirai-iter --example nested_stress -- 300
The argument is the pass count (default 300, maximum 20,000). Each pass checks all 1,025 outer results against the 1,025-element inner reduction.
Full documentation: https://docs.rs/moirai-iter
License
Licensed under either of Apache-2.0 or MIT at your option.