ParallelSliceExt

Trait ParallelSliceExt 

Source
pub trait ParallelSliceExt<T> {
    // Required methods
    fn chunked_map<R, F>(&self, config: &ChunkConfig, map_fn: F) -> Vec<R>
       where T: Sync,
             R: Send,
             F: Fn(&T) -> R + Sync;
    fn chunked_reduce<F>(
        &self,
        config: &ChunkConfig,
        identity: T,
        reduce_fn: F,
    ) -> T
       where T: Clone + Send + Sync,
             F: Fn(T, T) -> T + Sync;
}
Expand description

Extension trait for enhanced parallel operations on slices

Required Methods§

Source

fn chunked_map<R, F>(&self, config: &ChunkConfig, map_fn: F) -> Vec<R>
where T: Sync, R: Send, F: Fn(&T) -> R + Sync,

Map with automatic chunk optimization

Source

fn chunked_reduce<F>( &self, config: &ChunkConfig, identity: T, reduce_fn: F, ) -> T
where T: Clone + Send + Sync, F: Fn(T, T) -> T + Sync,

Reduce with automatic chunk optimization

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.

Implementations on Foreign Types§

Source§

impl<T> ParallelSliceExt<T> for [T]

Source§

fn chunked_map<R, F>(&self, config: &ChunkConfig, map_fn: F) -> Vec<R>
where T: Sync, R: Send, F: Fn(&T) -> R + Sync,

Source§

fn chunked_reduce<F>( &self, config: &ChunkConfig, identity: T, reduce_fn: F, ) -> T
where T: Clone + Send + Sync, F: Fn(T, T) -> T + Sync,

Implementors§