Skip to main content

Module threads

Module threads 

Source

Re-exports§

pub use crate::response::Response;
pub use actor::DEFAULT_REQUEST_TIMEOUT;

Structs§

ActorRef
External handle to a running actor. Cloneable, Send + Sync.
Context
Handle passed to every handler and lifecycle hook, providing access to the actor’s mailbox and lifecycle controls.
TimerHandle
Handle returned by send_after and send_interval.

Traits§

Actor
Trait for defining an actor’s lifecycle hooks.
ActorStart
Extension trait for starting an actor. Automatically implemented for all Actor types.
Handler
Per-message handler trait. Implement once for each message type the actor handles.
Receiver
Object-safe trait for sending a single message type to an actor.

Functions§

request
Send a request through a type-erased Receiver with a custom timeout.
send_after
Send a single message to an actor after a delay.
send_interval
Send a message to an actor repeatedly at a fixed interval.
send_message_on
Send a message to an actor when a blocking closure completes.
spawn_listener
Forward items from an iterator to an actor as messages.

Type Aliases§

Recipient
Type-erased reference for sending a single message type.