RangeFactory

Trait RangeFactory 

Source
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§

Required Methods§

Source

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.

Source

fn orchestrator(self) -> Self::Orchestrator

Returns the orchestrator object for all the ranges created by this factory.

Source

fn range(&self, thread_id: usize) -> Self::Rn

Returns the range for the given thread.

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§