Skip to main content

behavior/
lib.rs

1//! Pure actor algebra. A [`Behavior`] folds its associated event protocol into
2//! exactly [`Actions`]: sends, creates, and become. Timing, observation,
3//! supervision, stashing, and finite-state behavior are derived compositions.
4
5// The `workers!` macro emits `::behavior::…` paths; this alias lets
6// those expansions resolve inside this crate too (macro hygiene).
7extern crate self as behavior;
8
9#[path = "behavior.rs"]
10mod algebra;
11mod deadlined;
12mod stashing;
13mod supervising;
14mod verdict;
15mod watching;
16
17// `Fsm` is a thin state-machine helper built from the core stashing primitive.
18mod fsm;
19mod spec;
20
21pub use algebra::{
22    Acted, Actions, Address, Base, Become, Behavior, BirthMode, Births, Create, Delivery, FnState,
23    MailAddr, NoBirths, Recipient, Route, SendAlgebra, SendProduct, State, Transcript, User,
24    UserEvent, run,
25};
26pub use deadlined::{At, AtEvent, AtId, AtReaction, ScheduleAt, TimeEvent, TimeReached};
27pub use fsm::{Fsm, Move};
28pub use spec::Spec;
29pub use stashing::{StashRoute, Stashing};
30pub use supervising::{
31    ChildEvent, ChildStopped, ObserveChild, Proxy, ProxyCommand, RestartPolicy, Strategy,
32    Supervising, SupervisionEvent, restart_all, restart_one, restart_rest,
33};
34pub use verdict::{Never, Step};
35pub use watching::{
36    LinkReaction, ObservePeer, PeerEvent, PeerStopped, WatchEvent, Watching, stop_on_abnormal_death,
37};
38
39mod exit;
40
41pub use exit::{Crash, Exit};
42
43pub use behavior_macros::workers;