Trait DIPortal

Source
pub trait DIPortal {
    // Required method
    fn create_for_di(container: &DIContainer) -> Self;

    // Provided methods
    fn di_on(container: &DIContainer) -> DI<Self>
       where Self: Sized + DITarget { ... }
    fn di() -> DI<Self>
       where Self: Sized + DITarget { ... }
}
Expand description

Add di methods for DI target types.

Required Methods§

Source

fn create_for_di(container: &DIContainer) -> Self

Create new instance for DI.

Provided Methods§

Source

fn di_on(container: &DIContainer) -> DI<Self>
where Self: Sized + DITarget,

DI on a container.

Source

fn di() -> DI<Self>
where Self: Sized + DITarget,

DI on the global container.

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.

Implementors§