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 Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn message_status_reporting() -> MessageStatusReporting { ... }
}Expand description
A Handler allows an actor to handle a specific message type.
Required Methods§
Provided Methods§
Sourcefn message_status_reporting() -> MessageStatusReporting
fn message_status_reporting() -> MessageStatusReporting
Select which layer reports the message’s terminal telemetry status.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Handler<ActorSupervisionEvent> for ProcSupervisionCoordinator
impl Handler<PingPongMessage> for PingPongActor
impl<A: Actor> Handler<IntrospectMessage> for A
Blanket Handler impls for bypass-workq message types. Since these messages bypass workq, they will never be sent to actor’s handler.
These exist solely to lock the Handler<M> coherence slot for each bypass
type, so no specific impl Handler<BypassType> for SomeActor can be written.
The actual delivery for these types goes through dedicated channels set up
in Instance::new, not through Handler. See the matching sender-side check
in crate::ordering::Sequencer::assign_seq and the registry of bypass types
in [crate::ordering::is_bypass_workq_type_id].
impl<A: Actor> Handler<Undeliverable<MessageEnvelope>> for A
This handler provides a default behavior when a message sent by the actor to another is returned due to delivery failure.