Struct robots::actors::actor_ref::ActorRef
[−]
[src]
pub struct ActorRef { /* fields omitted */ }
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.
Methods
impl ActorRef
[src]
fn new_distant(path: Arc<ActorPath>) -> ActorRef
[src]
Creates a new ActorRef to a distant actor, with the given ActorPath.
fn with_cthulhu(cthulhu: Cthulhu) -> ActorRef
[src]
Creates a new ActorRef to Cthulhu, this should only be called once.
fn with_cell(cell: ActorCell, path: Arc<ActorPath>) -> ActorRef
[src]
Creates a new ActorRef for a local Actor, with the given ActorCell.
fn receive_system_message(&self, system_message: SystemMessage)
[src]
Receives a system message such as Start
, Restart
or a Failure(ActorRef)
, puts it in
the system mailbox and schedules the actor if needed.
fn receive(&self, message: InnerMessage, sender: ActorRef)
[src]
Receives a regular message and puts it in the mailbox and schedules the actor if needed.
fn handle(&self)
[src]
Handles a messages by calling the receive
method of the underlying actor.
fn path(&self) -> Arc<ActorPath>
[src]
Gives a clone of the ActorPath.
fn tell_to<MessageTo: Message>(&self, to: ActorRef, message: MessageTo)
[src]
Makes this ActorRef send a message to anther ActorRef.