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;
}
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§
sourcetype Result: MessageResponse<Self, M>
type Result: MessageResponse<Self, M>
The type of value that this handle will return
Required Methods§
Implementors§
source§impl Handler<Connect> for Resolver
impl Handler<Connect> for Resolver
type Result = Box<dyn ActorFuture<Actor = Resolver, Error = ResolverError, Item = TcpStream> + 'static, Global>
source§impl Handler<ConnectAddr> for Resolver
impl Handler<ConnectAddr> for Resolver
type Result = Box<dyn ActorFuture<Actor = Resolver, Error = ResolverError, Item = TcpStream> + 'static, Global>
source§impl Handler<Resolve> for Resolver
impl Handler<Resolve> for Resolver
type Result = Box<dyn ActorFuture<Actor = Resolver, Error = ResolverError, Item = VecDeque<SocketAddr, Global>> + 'static, Global>
source§impl Handler<Signal> for DefaultSignalsHandler
impl Handler<Signal> for DefaultSignalsHandler
Handle SIGINT
, SIGTERM
, SIGQUIT
signals and send SystemExit(0)
message to System
actor.