Expand description
behavior-macros — proc-macros for the behavior algebra.
workers! compiles a mixed fleet declaration into the erasure-free sum
a Supervising fleet requires (design: actorpass docs, surface talk #2):
(count, Type, build_fn) per worker kind → a Crew enum with a
delegated Behavior impl, a per-variant range crew_build, and the
total count. Crew is a TYPE — every worker stays its own actor.
v1 scope: every worker kind shares the SAME protocol (Event, Sends,
Done, Error, and Birth — taken from the first kind). Mixed
protocols need the hand-written sum (the CrewMsg widening is a
deliberate, documented step — not this macro’s job yet).
Macros§
- workers
workers![(4, WorkerA, build_a), (2, WorkerB, build_b)]→ a block declaring theCrewsum and yielding(total, crew_build)forSupervising’s fleet. Slots are contiguous per variant (slot = nonce; rest-for-one’s birth order is the declaration order).