Trait Worker
Source pub trait Worker<M: Send + Sized + Unpin + 'static>:
Send
+ Sync
+ Unpin
+ 'static {
// Required method
fn run<'life0, 'async_trait>(
&'life0 mut self,
msg: M,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn init<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn on_exit(&self) { ... }
}