pub struct ActorRef { /* private fields */ }
Expand description
An ActorRef
is the way used to interract with something that acts as an actor.
This can represent either an ACtor, a Future or Cthulhu (the original actor) whether distant or local.
It gives the Actor API, it can receive messages, be told to send messages, be asked something and give its ActorPath.
Implementations§
Source§impl ActorRef
impl ActorRef
Sourcepub fn new_distant(path: Arc<ActorPath>) -> ActorRef
pub fn new_distant(path: Arc<ActorPath>) -> ActorRef
Creates a new ActorRef to a distant actor, with the given ActorPath.
Sourcepub fn with_cthulhu(cthulhu: Cthulhu) -> ActorRef
pub fn with_cthulhu(cthulhu: Cthulhu) -> ActorRef
Creates a new ActorRef to Cthulhu, this should only be called once.
Sourcepub fn with_cell(cell: ActorCell, path: Arc<ActorPath>) -> ActorRef
pub fn with_cell(cell: ActorCell, path: Arc<ActorPath>) -> ActorRef
Creates a new ActorRef for a local Actor, with the given ActorCell.
Sourcepub fn receive_system_message(&self, system_message: SystemMessage)
pub fn receive_system_message(&self, system_message: SystemMessage)
Receives a system message such as Start
, Restart
or a Failure(ActorRef)
, puts it in
the system mailbox and schedules the actor if needed.
Sourcepub fn receive(&self, message: InnerMessage, sender: ActorRef)
pub fn receive(&self, message: InnerMessage, sender: ActorRef)
Receives a regular message and puts it in the mailbox and schedules the actor if needed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ActorRef
impl !RefUnwindSafe for ActorRef
impl Send for ActorRef
impl Sync for ActorRef
impl Unpin for ActorRef
impl !UnwindSafe for ActorRef
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