Expand description
An implementation of dependency injection.
If you do not know what is dependency injection (DI), please read this
discussion on StackOverflow, then come back. The only difference is that in
dptree
, we inject objects into function-handlers, not into objects.
Currently, the only container is DependencyMap
. It implements the DI
pattern completely, but be careful: it can panic when you do not provide
necessary types. See more in its documentation.
Structs
Turns a synchronous function into a type that implements Injectable
.
A DI container with multiple dependencies.
Traits
A DI container from which we can extract a value of a given type.
Converts functions into CompiledFn
.
Insert some value to a container.
Type Definitions
A function with all dependencies satisfied.