Trait Process

Source
pub trait Process<T: Send + 'static>
where Self: Send + Sync + Sized + 'static,
{ // Required method fn handle( &mut self, message: T, tx: &Sender<T>, ) -> impl Future<Output = T> + Send; // Provided methods fn spawn(self) -> impl Future<Output = ProcessInfo<T>> + Send { ... } fn run( &mut self, tx: &Sender<T>, rx: &mut Receiver<T>, ) -> impl Future<Output = ()> + Send { ... } fn main_loop( &mut self, tx: &Sender<T>, rx: &mut Receiver<T>, ) -> impl Future<Output = ()> + Send { ... } fn should_stop(&self) -> bool { ... } fn init(&mut self, _tx: &Sender<T>) -> impl Future<Output = ()> + Send { ... } fn receive( &mut self, tx: &Sender<T>, rx: &mut Receiver<T>, ) -> impl Future<Output = T> + Send { ... } }

Required Methods§

Source

fn handle( &mut self, message: T, tx: &Sender<T>, ) -> impl Future<Output = T> + Send

Provided Methods§

Source

fn spawn(self) -> impl Future<Output = ProcessInfo<T>> + Send

Source

fn run( &mut self, tx: &Sender<T>, rx: &mut Receiver<T>, ) -> impl Future<Output = ()> + Send

Source

fn main_loop( &mut self, tx: &Sender<T>, rx: &mut Receiver<T>, ) -> impl Future<Output = ()> + Send

Source

fn should_stop(&self) -> bool

Source

fn init(&mut self, _tx: &Sender<T>) -> impl Future<Output = ()> + Send

Source

fn receive( &mut self, tx: &Sender<T>, rx: &mut Receiver<T>, ) -> impl Future<Output = T> + Send

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§