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§
Required Methods§
Sourcefn init<J: JobUnit>(
self,
) -> (Self::Executor, Sender<ToRun<J>>, Sender<ExecutorResult>, Receiver<ExecutorResult>)
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
- The
Executor
object, - The send end of crossbeam communication channel ToRun,
- The send end of the crossbeam channel Results,
- 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.