Skip to main content

ParallelOps

Trait ParallelOps 

Source
pub trait ParallelOps {
    // Required methods
    fn parallel_execute<F, T>(&self, f: F) -> Result<T>
       where F: FnOnce(&ParallelContext) -> Result<T>;
    fn parallel_map<F, T>(&self, items: Vec<T>, f: F) -> Result<Vec<T>>
       where F: Fn(T, &ParallelContext) -> Result<T> + Send + Sync,
             T: Send;
}
Expand description

Parallel operations trait

Required Methods§

Source

fn parallel_execute<F, T>(&self, f: F) -> Result<T>
where F: FnOnce(&ParallelContext) -> Result<T>,

Execute operation in parallel context

Source

fn parallel_map<F, T>(&self, items: Vec<T>, f: F) -> Result<Vec<T>>
where F: Fn(T, &ParallelContext) -> Result<T> + Send + Sync, T: Send,

Map operation across parallel devices

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.

Implementors§