Skip to main content

Parallelizable

Trait Parallelizable 

Source
pub trait Parallelizable<T, R> {
    // Required method
    fn execute_parallel(&self, inputs: &[T], config: &ParallelConfig) -> Vec<R>;
}
Expand description

Trait for functions that can be parallelized

Required Methods§

Source

fn execute_parallel(&self, inputs: &[T], config: &ParallelConfig) -> Vec<R>

Execute the function in parallel on a batch of inputs

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, R, F> Parallelizable<T, R> for F
where F: Fn(&T) -> R + Sync, T: Sync, R: Send,

Implementation for any function that can be applied to a single input