Trait actix::prelude::Handler [] [src]

pub trait Handler<M, E = ()> where
    Self: Actor,
    M: ResponseType
{ fn handle(&mut self, msg: M, ctx: &mut Self::Context) -> Response<Self, M>; fn error(&mut self, err: E, ctx: &mut Self::Context) { ... } }

Message handler

Handler implementation is a general way how to handle incoming messages, streams, futures.

M is a message which can be handled by the actor. E is an optional error type, if message handler is used for handling Future or Stream results, then E type has to be set to correspondent Error type.

Required Methods

Method is called for every message received by this Actor

Provided Methods

Method is called on error. By default it does nothing.

Implementors