Trait actix::prelude::MessageHandler
[−]
[src]
pub trait MessageHandler<M> where
Self: Actor, { type Item; type Error; type InputError; fn handle(
&mut self,
msg: M,
ctx: &mut Context<Self>
) -> MessageFuture<Self, M>; fn error(&mut self, err: Self::InputError, ctx: &mut Context<Self>) { ... } }
Associated Types
type Item
The type of value that this message will resolved with if it is successful.
type Error
The type of error that this message will resolve with if it fails in a normal fashion.
type InputError
If message handler is used for handling messages from Future or Stream, then
InputError
type has to be set to correspondent Error
Required Methods
fn handle(&mut self, msg: M, ctx: &mut Context<Self>) -> MessageFuture<Self, M>
Method is called for every message received by this Actor
Provided Methods
fn error(&mut self, err: Self::InputError, ctx: &mut Context<Self>)
Method is called on error.
Implementors
impl MessageHandler<StopArbiter> for Arbiter type Item = (); type Error = (); type InputError = ();
impl MessageHandler<ArbiterAddress> for Arbiter type Item = SyncAddress<Arbiter>; type Error = (); type InputError = ();
impl MessageHandler<SystemExit> for System type Item = (); type Error = (); type InputError = ();