pub struct ActorHandle { /* private fields */ }Expand description
Handle to an actor for sending messages and querying state.
Implementations§
Source§impl ActorHandle
impl ActorHandle
Sourcepub async fn send(&self, payload: MessagePayload) -> Result<()>
pub async fn send(&self, payload: MessagePayload) -> Result<()>
Send a message to this actor.
Sourcepub async fn send_with_priority(
&self,
payload: MessagePayload,
priority: Priority,
) -> Result<()>
pub async fn send_with_priority( &self, payload: MessagePayload, priority: Priority, ) -> Result<()>
Send a message with a specific priority.
Sourcepub async fn send_from(
&self,
sender: ActorId,
payload: MessagePayload,
) -> Result<()>
pub async fn send_from( &self, sender: ActorId, payload: MessagePayload, ) -> Result<()>
Send a message from another actor.
Sourcepub fn state(&self) -> Option<ActorState>
pub fn state(&self) -> Option<ActorState>
Query the actor’s state.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the actor is running.
Sourcepub fn is_stopped(&self) -> bool
pub fn is_stopped(&self) -> bool
Check if the actor is stopped.
Sourcepub fn is_suspended(&self) -> bool
pub fn is_suspended(&self) -> bool
Check if the actor is suspended.
Sourcepub fn is_backpressured(&self) -> bool
pub fn is_backpressured(&self) -> bool
Check if the actor is in backpressure.
Sourcepub fn mailbox_size(&self) -> usize
pub fn mailbox_size(&self) -> usize
Get the mailbox size.
Sourcepub fn processed_count(&self) -> u64
pub fn processed_count(&self) -> u64
Get the number of messages processed by this actor.
Trait Implementations§
Source§impl Clone for ActorHandle
impl Clone for ActorHandle
Source§impl Debug for ActorHandle
impl Debug for ActorHandle
impl Eq for ActorHandle
Source§impl Hash for ActorHandle
impl Hash for ActorHandle
Auto Trait Implementations§
impl !RefUnwindSafe for ActorHandle
impl !UnwindSafe for ActorHandle
impl Freeze for ActorHandle
impl Send for ActorHandle
impl Sync for ActorHandle
impl Unpin for ActorHandle
impl UnsafeUnpin for ActorHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more