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<Syn, A>;impl<I: Send, E: Send> Handler<Execute<I, E>> for Arbiter type Result = Result<I, E>;
impl Handler<SystemExit> for System type Result = ();
impl Handler<Resolve> for Connector type Result = ResponseActFuture<Self, VecDeque<SocketAddr>, ConnectorError>;
impl Handler<Connect> for Connector type Result = ResponseActFuture<Self, TcpStream, ConnectorError>;
impl Handler<ConnectAddr> for Connector type Result = ResponseActFuture<Self, TcpStream, ConnectorError>;
impl Handler<Subscribe> for ProcessSignals type Result = ();
impl Handler<Signal> for DefaultSignalsHandler type Result = ();
impl<M: 'static, T: Sized + 'static> Handler<M> for Mocker<T> where
M: Message,
<M as Message>::Result: MessageResponse<Mocker<T>, M>, type Result = M::Result;