ExecutorBuilder

Trait ExecutorBuilder 

Source
pub trait ExecutorBuilder {
    type Executor: Executor;

    // Required method
    fn init<J: JobUnit>(
        self,
    ) -> (Self::Executor, Sender<ToRun<J>>, Sender<ExecutorResult>, Receiver<ExecutorResult>);
}
Expand description

Trait used to implement the function creating the communication channels and starting the worker threads.

Required Associated Types§

Source

type Executor: Executor

The associated Executor type.

Required Methods§

Source

fn init<J: JobUnit>( self, ) -> (Self::Executor, Sender<ToRun<J>>, Sender<ExecutorResult>, Receiver<ExecutorResult>)

Creates the communication channel ToRun and Results

The executor should accept jobs to run on ToRun, run them, and send the executor result on Results.

§Returns
  1. The Executor object,
  2. The send end of crossbeam communication channel ToRun,
  3. The send end of the crossbeam channel Results,
  4. The receive end of the crossbeam channel Results.

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§