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

Single method to be implemented for an Actor.

This defines the Actor's behaviour.

Provided Methods

Method called before the Actor is started.

Method called after the Actor is stopped.

Method called before the Actor is restarted.

Method called after the Actor is restarted.

Implementors