pub trait AsyncParallelIterator: AsyncIterator {
// Provided methods
fn par_map<F, Fut, R>(
self,
concurrency: usize,
map_fn: F,
) -> ParAsyncMap<Self, F>
where Self: Sized,
F: Fn(Self::Item) -> Fut + Send + Sync,
Fut: Future<Output = R> + Send,
R: Send { ... }
fn par_filter<F, Fut>(
self,
concurrency: usize,
filter_fn: F,
) -> ParAsyncFilter<Self, F>
where Self: Sized,
F: Fn(&Self::Item) -> Fut + Send + Sync,
Fut: Future<Output = bool> + Send { ... }
fn par_for_each<F, Fut>(
self,
concurrency: usize,
func: F,
) -> impl Future<Output = ()> + Send
where Self: Sized,
F: Fn(Self::Item) -> Fut + Send + Sync,
Fut: Future<Output = ()> + Send { ... }
}Expand description
Parallel async iterator for CPU+async hybrid workloads
Provided Methods§
Sourcefn par_map<F, Fut, R>(
self,
concurrency: usize,
map_fn: F,
) -> ParAsyncMap<Self, F>
fn par_map<F, Fut, R>( self, concurrency: usize, map_fn: F, ) -> ParAsyncMap<Self, F>
Execute async operations in parallel with controlled concurrency
Sourcefn par_filter<F, Fut>(
self,
concurrency: usize,
filter_fn: F,
) -> ParAsyncFilter<Self, F>
fn par_filter<F, Fut>( self, concurrency: usize, filter_fn: F, ) -> ParAsyncFilter<Self, F>
Parallel async filter with concurrency control
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".