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) { ... }
}

Required Methods§

Source

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§

Source

fn init<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn on_exit(&self)

Implementors§