pub trait DataParallel {
// Required methods
fn for_each_indexed<C, F>(
&self,
priority: Priority,
locality_hint: Option<usize>,
count: usize,
task: F,
) -> ExecutorResult<()>
where C: WorkClass,
F: Fn(usize) + Send + Sync;
fn map_reduce_indexed<C, T, Map, Reduce>(
&self,
priority: Priority,
locality_hint: Option<usize>,
count: usize,
identity: T,
map: Map,
reduce: Reduce,
) -> ExecutorResult<T>
where C: WorkClass,
T: Send + Clone,
Map: Fn(usize) -> T + Send + Sync,
Reduce: Fn(T, T) -> T + Send + Sync;
}Expand description
Indexed data-parallel fan-out without per-item result storage.
Calls partition non-empty domains across the available worker-plus-caller lanes. Operation-level execution policies own profitability thresholds before invoking this scheduler seam.
Required Methods§
Sourcefn for_each_indexed<C, F>(
&self,
priority: Priority,
locality_hint: Option<usize>,
count: usize,
task: F,
) -> ExecutorResult<()>
fn for_each_indexed<C, F>( &self, priority: Priority, locality_hint: Option<usize>, count: usize, task: F, ) -> ExecutorResult<()>
Apply task to every index in 0..count, completing before return.
§Errors
Returns an ExecutorError if the
scheduler is draining or a chunk panics.
Sourcefn map_reduce_indexed<C, T, Map, Reduce>(
&self,
priority: Priority,
locality_hint: Option<usize>,
count: usize,
identity: T,
map: Map,
reduce: Reduce,
) -> ExecutorResult<T>
fn map_reduce_indexed<C, T, Map, Reduce>( &self, priority: Priority, locality_hint: Option<usize>, count: usize, identity: T, map: Map, reduce: Reduce, ) -> ExecutorResult<T>
Map every index in 0..count and reduce the results with identity as
the neutral element of reduce.
§Errors
Returns an ExecutorError if the
scheduler is draining or a chunk panics.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".