Trait dptree::di::Injectable
source · [−]pub trait Injectable<Input, Output, FnArgs> {
fn inject<'a>(&'a self, container: &'a Input) -> CompiledFn<'a, Output>;
}
Expand description
Converts functions into CompiledFn
.
The function must follow some rules, to be usable with DI:
- For each function parameter of type
T
,Input
must satisfyDependencySupplier<T>
. - The function must be of 0-9 arguments.
- The function must return
Future
.