Trait actix::prelude::Handler [−][src]
pub trait Handler<M> where
Self: Actor,
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 Handler<StopArbiter> for Arbiter type Result = ();
impl<A> Handler<StartActor<A>> for Arbiter where
A: Actor<Context = Context<A>>, type Result = Addr<A>;impl<I: Send, E: Send> Handler<Execute<I, E>> for Arbiter type Result = Result<I, E>;
impl Handler<Resolve> for Resolver type Result = ResponseActFuture<Self, VecDeque<SocketAddr>, ResolverError>;
impl Handler<Connect> for Resolver type Result = ResponseActFuture<Self, TcpStream, ResolverError>;
impl Handler<ConnectAddr> for Resolver type Result = ResponseActFuture<Self, TcpStream, ResolverError>;
impl Handler<Subscribe> for ProcessSignals type Result = ();
impl Handler<Signal> for DefaultSignalsHandler type Result = ();