Trait actix_web::actix::actix::Handler [−]
pub trait Handler<M>: Actor + 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
Required Methods
fn handle(&mut self, msg: M, ctx: &mut Self::Context) -> Self::Result
Method is called for every message received by this Actor
Implementors
impl<I, E> Handler<Execute<I, E>> for Arbiter where
E: Send,
I: Send, type Result = Result<I, E>;impl Handler<Resolve> for Resolver type Result = Box<ActorFuture<Error = ResolverError, Item = VecDeque<SocketAddr>, Actor = Resolver> + 'static>;
impl Handler<StopArbiter> for Arbiter type Result = ();
impl Handler<Signal> for DefaultSignalsHandler type Result = ();
impl Handler<ConnectAddr> for Resolver type Result = Box<ActorFuture<Error = ResolverError, Item = TcpStream, Actor = Resolver> + 'static>;
impl<A> Handler<StartActor<A>> for Arbiter where
A: Actor<Context = Context<A>>, type Result = Addr<A>;impl Handler<Subscribe> for ProcessSignals type Result = ();
impl Handler<Connect> for Resolver type Result = Box<ActorFuture<Error = ResolverError, Item = TcpStream, Actor = Resolver> + 'static>;
impl Handler<Pause> for ClientConnector type Result = ();
impl Handler<Resume> for ClientConnector type Result = ();
impl Handler<Connect> for ClientConnector type Result = ActorResponse<ClientConnector, Connection, ClientConnectorError>;
impl<H: IntoHttpHandler> Handler<Signal> for HttpServer<H> type Result = ();
impl<H: IntoHttpHandler> Handler<PauseServer> for HttpServer<H> type Result = ();
impl<H: IntoHttpHandler> Handler<ResumeServer> for HttpServer<H> type Result = ();
impl<H: IntoHttpHandler> Handler<StopServer> for HttpServer<H> type Result = Response<(), ()>;