[][src]Trait xtra::AsyncHandler

pub trait AsyncHandler<M: Message>: Actor {
    type Responder: Future<Output = M::Result> + Send;
    fn handle<'a>(
        &'a mut self,
        message: M,
        ctx: &'a mut Context<Self>
    ) -> Self::Responder; }

A trait indicating that an Actor can handle a given Message asynchronously, and the logic to handle the message.

Associated Types

type Responder: Future<Output = M::Result> + Send

Loading content...

Required methods

fn handle<'a>(
    &'a mut self,
    message: M,
    ctx: &'a mut Context<Self>
) -> Self::Responder

Handle a given message, returning a future eventually resolving to its result.

Loading content...

Implementors

Loading content...