Expand description
Lock-free DI engine + macro registration descriptors.
Two-phase lifecycle:
-
Boot.
DiContainerBuildercollectsProviderDescriptors emitted by#[Injectable]/#[Module]. It topologically sorts them byTypeIddependency edges, detects cycles deterministically, then invokes each provider’sbuildfunction in dependency order. The build function receives aResolverview of already-constructed singletons. -
Run. The container is
Box::leak-ed to&'static FrozenDiContainer. Every subsequent read is a singleHashMap::get+ downcast, both inlined. Zero locks, zero allocations on the request path.
Structs§
- DiContainer
Builder - Mutable builder used only during boot.
- Frozen
DiContainer - Immutable, lock-free DI container. Reads are O(1) and inlined.
- Module
Descriptor - Emitted by
#[Module]. Owns its providers, the controllers it exposes, and the imports it pulls in. Used to walk the module DAG at boot. - Param
Spec - Provider
Descriptor - One row in the dependency graph.
- Resolver
- Build-time resolver passed to each provider’s
buildfn. Returns the already-constructed dependency byTypeId. Panics if a dependency hasn’t been built yet — topological order guarantees this can’t happen for a well-formed graph. - Route
Descriptor - Route
Spec
Enums§
Traits§
- Module
- Implemented by every
#[Module]-annotated struct soApp::launch::<RootMod>can find the entry point without a runtime registry lookup.