Trait actix_web::actix::dev::Handler

source ·
pub trait Handler<M>: Actorwhere
    M: Message,
{ type Result: MessageResponse<Self, M>; fn handle(&mut self, msg: M, ctx: &mut Self::Context) -> Self::Result; }
Expand description

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.

Required Associated Types

The type of value that this handle will return

Required Methods

Method is called for every message received by this Actor

Implementations on Foreign Types

Signals support Handle SIGINT, SIGTERM, SIGQUIT signals and stop actix system message to System actor.

Implementors

Handle SIGINT, SIGTERM, SIGQUIT signals and send SystemExit(0) message to System actor.

Add subscriber for signals