Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The Standard Library as Architecture

Rust fundamentalsTypes encode accessRevision 78002f6
  • TypeId identifies component, resource, system, and schedule types at runtime.
  • HashMap and dense/sparse tables connect those IDs to storage and metadata.
  • FixedBitSet makes dependency, readiness, conflict, and completion sets cheap to combine.
  • Mutex protects executor state shared by scoped worker tasks, while the world itself is accessed through scheduler-proven disjointness.
  • Arc makes services such as AssetServer cheaply cloneable across background tasks.
  • PhantomData preserves generic type/lifetime relationships in zero-sized parameter and handle machinery.
  • Any and downcasting support heterogeneous registries at deliberate runtime boundaries.
  • Result lets 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.