1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! This module contains all data structures for creating and using actors and their
//! respective functionality.
//! All actors consist of an inital state and behavior. Example:
//! ```
//! use aector::actor::{Actor, MailboxType};
//! use aector::behavior::{Behavior, BehaviorBuilder, BehaviorAction};
//!
//! struct PingPong {}
//! // enum used as message
//! enum Ball { Ping, Pong }
//!
//! // define behavior for actor
//! let mut behavior = BehaviorBuilder::new()
//! .on_ask::<Ball>(|msg, state, sender, ctx| -> BehaviorAction<PingPong> {
//! match msg {
//! Ball::Ping => {
//! sender.ask(Ball::Pong, ctx.get_addr());
//! },
//! Ball::Pong => {
//! sender.ask(Ball::Ping, ctx.get_addr());
//! }
//! }
//! Behavior::keep()
//! })
//! .build();
//! let mut actor = Actor::new(PingPong {}, behavior, MailboxType::Unbounded);
//! let addr = actor1.get_addr();
//! ```
pub use ;
pub use Backup;
pub use ;