Trait salak::Factory[][src]

pub trait Factory: Sized {
    type Env: Environment;
    fn env(&self) -> &Self::Env;
fn get_or_build<T: FromFactory>(&self) -> Result<FacRef<T>, PropertyError>; fn init<T: FromFactory>(&self) -> Result<(), PropertyError> { ... } }

A factory.

Associated Types

type Env: Environment[src]

Factory environment.

Loading content...

Required methods

fn env(&self) -> &Self::Env[src]

Get environment.

fn get_or_build<T: FromFactory>(&self) -> Result<FacRef<T>, PropertyError>[src]

Get reference of specified type. If FactoryScope is [FactoryScope::registrySingleton], then return cached value, otherwise create a new one.

Loading content...

Provided methods

fn init<T: FromFactory>(&self) -> Result<(), PropertyError>[src]

Initialize some value.

Loading content...

Implementors

impl Factory for Salak[src]

type Env = Salak

Loading content...