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 fundamentalsForeign lifecycle made explicitRevision 637cef7
  • Raw pointers represent the ABI fact that Godot supplies object and value addresses; safe wrappers validate before exposing behavior.
  • PhantomData attaches class, ownership, and non-Send meaning without changing the pointer layout.
  • TypeId and HashMap support class and dynamic-trait registries.
  • AtomicBool and atomics record initialization/hot-reload state shared with callbacks.
  • Cell stores isolate/main-thread lifecycle state; mutex-backed globals are used for registration paths and fail fast on unexpected concurrency.
  • catch_unwind prevents a panic from leaving a Rust-controlled trampoline.
  • Future, Poll, Waker, and thread-local storage implement the local async bridge.
  • guard Drop releases dynamic borrows even on early returns and panics.

The standard library supplies mechanisms; the binding’s real work is assigning them semantics matching Godot’s ownership contract.