pub trait Handler<M>: Actor {
// Required method
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
message: M,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}
Expand description
A Handler allows an actor to handle a specific message type.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl Handler<CommActorMode> for CommActor
impl Handler<CommActorMode> for CommActor
Source§impl Handler<TestMessage> for TestActor
impl Handler<TestMessage> for TestActor
Source§impl Handler<LogClientMessage> for LogClientActor
impl Handler<LogClientMessage> for LogClientActor
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, LogClientActor>,
message: LogClientMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
LogClientActor: 'async_trait,
Source§impl Handler<LogForwardMessage> for LogForwardActor
impl Handler<LogForwardMessage> for LogForwardActor
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, LogForwardActor>,
message: LogForwardMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
LogForwardActor: 'async_trait,
Source§impl Handler<LogMessage> for LogClientActor
impl Handler<LogMessage> for LogClientActor
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, LogClientActor>,
message: LogMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
LogClientActor: 'async_trait,
Source§impl Handler<ActorSupervisionEvent> for MeshAgent
impl Handler<ActorSupervisionEvent> for MeshAgent
Source§impl Handler<CastMessage> for CommActor
impl Handler<CastMessage> for CommActor
Source§impl Handler<EmptyMessage> for EmptyActor
impl Handler<EmptyMessage> for EmptyActor
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_: &'life1 Context<'_, EmptyActor>,
__arg2: EmptyMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
EmptyActor: 'async_trait,
Implementors§
impl Handler<MailboxAdminMessage> for ProcActor
impl Handler<ProcMessage> for ProcActor
impl Handler<ProcSupervisionMessage> for SystemActor
impl Handler<WorldSupervisionMessage> for SystemActor
impl Handler<SystemMessage> for SystemActor
impl Handler<ActorSupervisionEvent> for ProcSupervisionCoordinator
impl Handler<ActorSupervisionEvent> for ProcActor
impl Handler<PingPongMessage> for PingPongActor
impl Handler<ProcStopResult> for SystemActor
impl<A> Handler<Signal> for Awhere
A: Actor,
We provide this handler to indicate that actors can handle the Signal
message.
Its actual handler is implemented by the runtime.
impl<A> Handler<Undeliverable<MessageEnvelope>> for Awhere
A: Actor,
This handler provides a default behavior when a message sent by the actor to another is returned due to delivery failure.
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
This handler enables actors to unbind the IndexedErasedUnbound message, and forward the result to corresponding handler.