Struct ioc::ContainerBuilder [] [src]

pub struct ContainerBuilder<Key, SvcBase: ?Sized> {
    // some fields omitted
}

Methods

impl<Key, SvcBase: ?Sized> ContainerBuilder<Key, SvcBase> where Key: Key, SvcBase: Any
[src]

fn new() -> Self

fn register_service(&mut self, key: Key, svc: Box<SvcBase>) -> &mut Self

fn register<Svc>(&mut self, svc: Svc) -> &mut Self where Svc: Service<Key=Key>, Box<Svc>: Into<Box<SvcBase>>

NOTE: The Box<Svc>: Into<Box<Base>>-clause is needed due to rusts lack of HKT or a Coercible-trait (to name two solutions).

fn build(self) -> Container<Key, SvcBase>