Skip to main content

FromDi

Trait FromDi 

Source
pub trait FromDi: Sized {
    // Required methods
    fn depends_on() -> &'static [TypeMeta];
    fn produce(services: &Services) -> Result<Self, Error>;
}
Expand description

Represents an object that’s capable of building itself from a DI instance.

Required Methods§

Source

fn depends_on() -> &'static [TypeMeta]

Source

fn produce(services: &Services) -> Result<Self, Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: ?Sized + Send + Sync + 'static> FromDi for Resolved<T>

Source§

impl<T: ?Sized + Send + Sync + 'static> FromDi for ResolvedMany<T>