pub trait Provider {
type ProvidedType: 'static;
// Required method
fn provide(
&self,
container: &Container,
) -> Result<Self::ProvidedType, InjectError>;
// Provided method
fn id(&self) -> TypeId { ... }
}Expand description
Value provider.
Required Associated Types§
type ProvidedType: 'static
Required Methods§
Sourcefn provide(
&self,
container: &Container,
) -> Result<Self::ProvidedType, InjectError>
fn provide( &self, container: &Container, ) -> Result<Self::ProvidedType, InjectError>
Provides the value using the Container
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".