Struct tiny_tokio_actor::ActorRef
source · 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> !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