Trait teloc::Dependency [−][src]
pub trait Dependency<Deps> {
fn init(deps: Deps) -> Self;
}
Expand description
Trait is used to working with Resolver
trait. If you want that your service can be resolved by
Resolver
, you may implement this trait for your service. There are three ways:
- Implement it by yourself. Not recommended for production code, recommended for library code.
- Create a constructor and add
#[inject]
macro. Recommended for production code. - Derive
Teloc
macro, when all of your fields of structs implementDependency
.