Trait Injectable

Source
pub trait Injectable:
    'static
    + Send
    + Sync {
    // Required method
    fn from_container(container: &Container) -> Self;
}
Expand description

Trait that marks a struct or enum as a possible member of a DI Container.

Required Methods§

Source

fn from_container(container: &Container) -> Self

Method allows to initialize trait object from a DI 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§