Trait robots::actors::Actor
[−]
[src]
pub trait Actor: Send + Sync + 'static { fn receive(&self, message: Box<Any>, context: ActorCell); fn pre_start(&self, _context: ActorCell) { ... } fn post_stop(&self) { ... } fn pre_restart(&self, _context: ActorCell) { ... } fn post_restart(&self, context: ActorCell) { ... } }
This is the trait to implement to become an Actor.
Normaly only the receive method has to be implemented.
Required Methods
fn receive(&self, message: Box<Any>, context: ActorCell)
Single method to be implemented for an Actor.
This defines the Actor's behaviour.
Provided Methods
fn pre_start(&self, _context: ActorCell)
Method called before the Actor is started.
fn post_stop(&self)
Method called after the Actor is stopped.
fn pre_restart(&self, _context: ActorCell)
Method called before the Actor is restarted.
fn post_restart(&self, context: ActorCell)
Method called after the Actor is restarted.