pub trait Injectable:
Send
+ Sync
+ 'static {
// Required methods
fn create(container: &Container) -> BoxFuture<'_, Result<Self>>
where Self: Sized;
fn dependencies() -> Vec<ProviderDependency>
where Self: Sized;
// Provided methods
fn on_module_init(&self) -> BoxFuture<'_, Result<()>> { ... }
fn on_bootstrap(&self) -> BoxFuture<'_, Result<()>> { ... }
fn on_shutdown(&self) -> BoxFuture<'_, Result<()>> { ... }
}Required Methods§
fn create(container: &Container) -> BoxFuture<'_, Result<Self>>where
Self: Sized,
Sourcefn dependencies() -> Vec<ProviderDependency>where
Self: Sized,
fn dependencies() -> Vec<ProviderDependency>where
Self: Sized,
Dependencies resolved while constructing this provider.
#[injectable] supplies this automatically. Handwritten implementations
must return provider_dependencies![...]; Caelix rejects construction-time
resolution of a provider that is absent from this declaration.
Provided Methods§
fn on_module_init(&self) -> BoxFuture<'_, Result<()>>
fn on_bootstrap(&self) -> BoxFuture<'_, Result<()>>
fn on_shutdown(&self) -> BoxFuture<'_, Result<()>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".