The Standard Library as Architecture
TypeIdidentifies component, resource, system, and schedule types at runtime.HashMapand dense/sparse tables connect those IDs to storage and metadata.FixedBitSetmakes dependency, readiness, conflict, and completion sets cheap to combine.Mutexprotects executor state shared by scoped worker tasks, while the world itself is accessed through scheduler-proven disjointness.Arcmakes services such asAssetServercheaply cloneable across background tasks.PhantomDatapreserves generic type/lifetime relationships in zero-sized parameter and handle machinery.Anyand downcasting support heterogeneous registries at deliberate runtime boundaries.Resultlets systems and commands participate in configurable error policy.
The striking point is that &T versus &mut T is not just local syntax. Bevy
turns that standard borrowing distinction into global scheduling metadata.