pub trait Actor:
Send
+ Sync
+ 'static {
// Required method
fn receive(&self, message: Box<dyn Any>, context: ActorCell);
// Provided methods
fn pre_start(&self, _context: ActorCell) { ... }
fn post_stop(&self) { ... }
fn pre_restart(&self, _context: ActorCell) { ... }
fn post_restart(&self, context: ActorCell) { ... }
}Expand description
This is the trait to implement to become an Actor.
Normaly only the receive method has to be implemented.
Required Methods§
Provided Methods§
Sourcefn pre_restart(&self, _context: ActorCell)
fn pre_restart(&self, _context: ActorCell)
Method called before the Actor is restarted.
Sourcefn post_restart(&self, context: ActorCell)
fn post_restart(&self, context: ActorCell)
Method called after the Actor is restarted.