pub struct ActorRef<E: SystemEvent, A: Actor<E>> { /* private fields */ }Expand description
A clonable actor reference. It basically holds a Sender that can send messages to the mailbox (receiver) of the actor.
Implementations§
Source§impl<E: SystemEvent, A: Actor<E>> ActorRef<E, A>
impl<E: SystemEvent, A: Actor<E>> ActorRef<E, A>
Sourcepub fn tell<M>(&self, msg: M) -> Result<(), ActorError>
pub fn tell<M>(&self, msg: M) -> Result<(), ActorError>
Fire and forget sending of messages to this actor.
Sourcepub async fn ask<M>(&self, msg: M) -> Result<M::Response, ActorError>
pub async fn ask<M>(&self, msg: M) -> Result<M::Response, ActorError>
Send a message to an actor, expecting a response.
Trait Implementations§
Auto Trait Implementations§
impl<E, A> Freeze for ActorRef<E, A>
impl<E, A> RefUnwindSafe for ActorRef<E, A>
impl<E, A> Send for ActorRef<E, A>
impl<E, A> Sync for ActorRef<E, A>
impl<E, A> Unpin for ActorRef<E, A>
impl<E, A> UnwindSafe for ActorRef<E, A>
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