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::{
27    At, AtEvent, AtGeneration, AtId, AtReaction, ScheduleAt, TimeEvent, TimeReached,
28};
29pub use fsm::{Fsm, Move};
30pub use spec::Spec;
31pub use stashing::{StashRoute, Stashing};
32pub use supervising::{
33    ChildEvent, ChildStopped, ObserveChild, Proxy, ProxyCommand, RestartPolicy, Strategy,
34    Supervising, SupervisionEvent, restart_all, restart_one, restart_rest,
35};
36pub use verdict::{Never, Step};
37pub use watching::{
38    LinkReaction, ObservePeer, PeerEvent, PeerStopped, WatchEvent, Watching, stop_on_abnormal_death,
39};
40
41mod exit;
42
43pub use exit::{Crash, Exit};
44
45pub use behavior_macros::workers;