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.

Object Safety§

This trait is not object safe.

Implementors§