Struct ioc::IocBuilder [] [src]

pub struct IocBuilder<Key = str, Base: ?Sized = DefaultBase> {
    // some fields omitted
}

TODO This type needs some ironing out.

Methods

impl<Key, Base: ?Sized> IocBuilder<Key, Base> where Key: Debug + Ord, Base: Any
[src]

fn new() -> Self

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

fn register<Svc>(&mut self, svc: Svc) -> &mut Self where Svc: ServiceReflect, Svc::Key: ToOwned<Owned=Key>, Key: Borrow<Svc::Key>, Box<Svc>: Into<Box<Base>>

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) -> Ioc<Key, Base>