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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
//! Akka-style actor library for Rust, built on tokio.
//!
//! Multiple actor types share a single [`ActorSystem`]; addresses route
//! messages with compile-time message-type checks (`send::<T>` only accepts
//! `T::Message`). Each actor runs on its own task with a bounded or
//! unbounded mailbox, an [`ErrorHandling`] policy, and standard lifecycle
//! hooks ([`pre_start`], [`pre_restart`], [`post_stop`], [`post_restart`]).
//!
//! The optional `multi-node` feature extends the same API across processes
//! via a [xanq](https://crates.io/crates/xanq) broker — see the
//! `inter_node` module and the project wiki for setup details.
//!
//! See the [project wiki](https://xanthorrhizol.github.io/actor/) for the
//! full guide.
//!
//! [`pre_start`]: actor::Actor::pre_start
//! [`pre_restart`]: actor::Actor::pre_restart
//! [`post_stop`]: actor::Actor::post_stop
//! [`post_restart`]: actor::Actor::post_restart
pub use *;
pub use *;
pub use ActorError;
pub use ;
pub use ;
/// Default per-actor mailbox capacity. Used whenever
/// `Actor::register`'s `channel_size` argument is `None`. Active under
/// `bounded-channel`; ignored under `unbounded-channel` but kept defined
/// so the unified API surface compiles.
pub const CHANNEL_SIZE: usize = 4096;
extern crate log;
/// Lifecycle state of a registered actor as tracked by `actor_system_loop`.
///
/// Drives which lifecycle hook fires next and whether `FindActor` reports
/// the actor as ready for delivery:
///
/// - `Starting`/`Restarting` → mailbox exists but `FindActor` returns
/// `ready=false`; the system loop reports the actor isn't ready yet.
/// - `Receiving` → normal operation; sends go through immediately.
/// - `Stopping`/`Terminated` → terminal phase; the actor task is winding
/// down or finished. Subsequent sends fail.
/// Policy applied when an actor's `handle` returns `Err`.
///
/// Passed to `Actor::register` and consulted on every handler error.
/// Choice of tokio task primitive used to host the actor's receive loop.
///
/// Picked per actor at `register` time.
/// Snapshot status for a running job (returned only via `JobController`'s
/// internal channels — currently exposed for completeness; the public API
/// uses `abort_job` / `stop_job` / `resume_job` directly).
/// Bound on `Actor::Message` / `Actor::Result`.
///
/// - Without `multi-node`: vacuous (`impl<T: ?Sized> MaybeCodec for T`),
/// every type satisfies it — single-node users see no extra constraint.
/// - With `multi-node`: a supertrait alias for `xancode::Codec`, so any
/// message/result that travels through `send` / `send_and_recv` /
/// `run_job` must be serializable. Local routing still skips encoding,
/// but the bound is enforced at compile time regardless.
///
/// Implemented automatically via blanket impl; you should never need to
/// implement it manually.