pub trait RangeFactory {
type Rn: Range;
type Orchestrator: RangeOrchestrator;
// Required methods
fn new(num_elements: usize, num_threads: usize) -> Self;
fn orchestrator(self) -> Self::Orchestrator;
fn range(&self, thread_id: usize) -> Self::Rn;
}Expand description
A factory for handing out ranges of items to various threads.
Required Associated Types§
type Rn: Range
type Orchestrator: RangeOrchestrator
Required Methods§
Sourcefn new(num_elements: usize, num_threads: usize) -> Self
fn new(num_elements: usize, num_threads: usize) -> Self
Creates a new factory for a range with the given number of elements split across the given number of threads.
Sourcefn orchestrator(self) -> Self::Orchestrator
fn orchestrator(self) -> Self::Orchestrator
Returns the orchestrator object for all the ranges created by this factory.
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.