[][src]Trait actix_web::actix::Handler

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

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.

Associated Types

type Result: MessageResponse<Self, M>

The type of value that this handle will return

Loading content...

Required methods

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

Method is called for every message received by this Actor

Loading content...

Implementors

impl Handler<Connect> for Resolver[src]

type Result = Box<dyn ActorFuture<Item = TcpStream, Error = ResolverError, Actor = Resolver> + 'static>

impl Handler<ConnectAddr> for Resolver[src]

type Result = Box<dyn ActorFuture<Item = TcpStream, Error = ResolverError, Actor = Resolver> + 'static>

impl Handler<Resolve> for Resolver[src]

type Result = Box<dyn ActorFuture<Item = VecDeque<SocketAddr>, Error = ResolverError, Actor = Resolver> + 'static>

impl Handler<Signal> for DefaultSignalsHandler[src]

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

type Result = ()

impl Handler<Subscribe> for ProcessSignals[src]

Add subscriber for signals

type Result = ()

impl Handler<StopArbiter> for Arbiter[src]

type Result = ()

impl Handler<Connect> for ClientConnector[src]

impl Handler<Pause> for ClientConnector[src]

type Result = ()

impl Handler<Resume> for ClientConnector[src]

type Result = ()

impl<A> Handler<StartActor<A>> for Arbiter where
    A: Actor<Context = Context<A>>, 
[src]

type Result = Addr<A>

impl<I, E> Handler<Execute<I, E>> for Arbiter where
    E: Send,
    I: Send
[src]

type Result = Result<I, E>

impl<M, T> Handler<M> for Mocker<T> where
    M: 'static + Message,
    T: 'static,
    <M as Message>::Result: MessageResponse<Mocker<T>, M>, 
[src]

type Result = <M as Message>::Result

Loading content...