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 ProcMeshAgent
impl Handler<ActorSupervisionEvent> for ProcMeshAgent
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, ProcMeshAgent>,
event: ActorSupervisionEvent,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ProcMeshAgent: 'async_trait,
Source§impl Handler<ActorSupervisionEvent> for TestActorWithSupervisionHandling
impl Handler<ActorSupervisionEvent> for TestActorWithSupervisionHandling
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, TestActorWithSupervisionHandling>,
_msg: ActorSupervisionEvent,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
TestActorWithSupervisionHandling: 'async_trait,
Source§impl Handler<CastMessage> for CommActor
impl Handler<CastMessage> for CommActor
Source§impl Handler<CreateOrUpdate<()>> for HostMeshAgent
impl Handler<CreateOrUpdate<()>> for HostMeshAgent
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, HostMeshAgent>,
create_or_update: CreateOrUpdate<()>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
HostMeshAgent: 'async_trait,
Source§impl Handler<CreateOrUpdate<ActorSpec>> for ProcMeshAgent
impl Handler<CreateOrUpdate<ActorSpec>> for ProcMeshAgent
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, ProcMeshAgent>,
create_or_update: CreateOrUpdate<ActorSpec>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ProcMeshAgent: 'async_trait,
Source§impl Handler<GetRankStatus> for ProcMeshAgent
impl Handler<GetRankStatus> for ProcMeshAgent
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, ProcMeshAgent>,
get_rank_status: GetRankStatus,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ProcMeshAgent: 'async_trait,
Source§impl Handler<GetRankStatus> for HostMeshAgent
impl Handler<GetRankStatus> for HostMeshAgent
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, HostMeshAgent>,
get_rank_status: GetRankStatus,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
HostMeshAgent: 'async_trait,
Source§impl Handler<GetState<ActorState>> for ProcMeshAgent
impl Handler<GetState<ActorState>> for ProcMeshAgent
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, ProcMeshAgent>,
get_state: GetState<ActorState>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ProcMeshAgent: 'async_trait,
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,
Source§impl Handler<ShutdownHost> for HostMeshAgent
impl Handler<ShutdownHost> for HostMeshAgent
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, HostMeshAgent>,
msg: ShutdownHost,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
HostMeshAgent: 'async_trait,
Source§impl Handler<CauseSupervisionEvent> for TestActor
impl Handler<CauseSupervisionEvent> for TestActor
Source§impl Handler<GetActorId> for TestActor
impl Handler<GetActorId> for TestActor
Source§impl Handler<GetCastInfo> for TestActor
impl Handler<GetCastInfo> for TestActor
Source§impl Handler<MeshAgentMessage> for ProcMeshAgent
impl Handler<MeshAgentMessage> for ProcMeshAgent
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<OncePortRef<ActorId>> for EchoActor
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.