pub trait Dependency<Deps> {
// Required method
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
Telocmacro, when all of your fields of structs implementDependency.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.