pub trait Process<T: Send + 'static>{
// Required method
fn handle(&mut self, message: T, tx: &Sender<T>) -> T;
// Provided methods
fn spawn(self) -> ProcessInfo<T> { ... }
fn run(&mut self, tx: &Sender<T>, rx: &mut Receiver<T>) { ... }
fn main_loop(&mut self, tx: &Sender<T>, rx: &mut Receiver<T>) { ... }
fn should_stop(&self) -> bool { ... }
fn init(&mut self, _tx: &Sender<T>) { ... }
fn receive(&mut self, tx: &Sender<T>, rx: &mut Receiver<T>) -> T { ... }
}Required Methods§
Provided Methods§
fn spawn(self) -> ProcessInfo<T>
fn run(&mut self, tx: &Sender<T>, rx: &mut Receiver<T>)
fn main_loop(&mut self, tx: &Sender<T>, rx: &mut Receiver<T>)
fn should_stop(&self) -> bool
fn init(&mut self, _tx: &Sender<T>)
fn receive(&mut self, tx: &Sender<T>, rx: &mut Receiver<T>) -> T
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.