rust_dependencies
Typed dependency injection for Rust
Register values by type, swap live vs test implementations, and override individual deps without global state.
Install
[]
= "0.1.1"
Quick start
use ;
let bag = test;
let uuid = bag..unwrap.0.next;
assert_ne!;
Built-in dependencies
| Key | Purpose |
|---|---|
ClockKey |
Monotonic Instant (debounce, elapsed time) |
NowKey |
Wall SystemTime (timestamps) |
UuidKey |
Unique u128 identifiers |
RngKey |
u64 random draws |
Each key provides live() (production) and test() (deterministic) via [DependencyKey].
Documentation
- In-depth guide:
book/dependencies.md - API docs:
cargo doc --open
Used by
rust-elm re-exports this crate for effect environments and runtime wiring.
License
MPL-2.0 — see LICENSE.