[][src]Trait xtra::Handler

pub trait Handler<M: Message>: Actor {
    fn handle(&mut self, message: M, ctx: &mut Context<Self>) -> M::Result;
}

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

Required methods

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

Handle a given message, returning its result.

Loading content...

Implementors

Loading content...