Trait theatre::Handler[][src]

pub trait Handler<M> where
    Self: Sized + Actor,
    M: Message,
    M::Return: Send
{ #[must_use] fn handle<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        msg: M,
        context: &'life1 mut Context<Self>
    ) -> Pin<Box<dyn Future<Output = M::Return> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }

The Handler trait allows for an actor to have a per-message type handle implementation.

Handler is an async_trait so implementors must attribute their implantation with #[async_trait]

Required methods

#[must_use]fn handle<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    msg: M,
    context: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = M::Return> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Loading content...

Implementors

impl<A> Handler<SuperviseActor<A>> for Supervisor where
    A: 'static + Actor + Supervised
[src]

Loading content...