rskit-di — Dependency Injection Container
Lightweight Arc-based runtime dependency injection container.
Features
- Three registration modes: eager (
register), lazy factory (register_factory), singleton (register_singleton) - Type-keyed resolution via
TypeId— no strings, no macros Resolve<T>trait for constructor-oriented workflows- Thread-safe with
parking_lot::RwLock Closeabletrait for async resource cleanup- Returns
AppResultfor idiomatic error handling
Usage
[]
= "0.2.0-alpha.4"
use Arc;
use Container;
let container = new;
container.register;
let cfg: = container.resolve?;
assert_eq!;
# Ok::