The Standard Library as Architecture
PathandPathBufdistinguish borrowed locations from owned paths moved into workers.Arc<T>shares immutable distributions, caches, reporters, and semaphore budgets.HashMap/HashSetencode package indexes, installed state, and plan membership.BTreeMapsupplies deterministic serialization where reproducible lock output matters.NonZeroUsizeandavailable_parallelism()connect configuration to a valid machine-derived default.Cow<'a, T>avoids cloning unchanged requirements while still allowing marker-adjusted owned variants.- filesystem handles and RAII lock guards make process-level ownership end on drop.
Command,ExitStatus, and pipes model Python/build tools as fallible external actors.
Most performance comes from choosing which values are immutable and reusable.
An Arc<Dist> can cross many futures; the mutable environment cannot. A
PathBuf moved into spawn_blocking is simple proof that the task does not
retain a borrowed command context.