pub trait DistributedSliceExt<T> {
// Required method
fn distributed_process<R, F>(
&self,
process_fn: F,
chunk_size: usize,
n_workers: usize,
) -> Vec<R>
where T: Send + Sync + Clone + 'static,
R: Send + 'static,
F: Fn(&[T]) -> Vec<R> + Send + Clone + 'static;
}Expand description
Extension trait that adds distributed-aware parallel processing to slices.
Required Methods§
Sourcefn distributed_process<R, F>(
&self,
process_fn: F,
chunk_size: usize,
n_workers: usize,
) -> Vec<R>
fn distributed_process<R, F>( &self, process_fn: F, chunk_size: usize, n_workers: usize, ) -> Vec<R>
Divide the slice into chunks, process each chunk in parallel, and concatenate the results in input order.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.