Struct ioc::Ioc [] [src]

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

TODO naming?

Methods

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

fn services(&self) -> &BTreeMap<Key, RwLock<Box<Base>>>

fn invoke<'a, M>(&'a self, args: M::Args) -> Result<M::Ret, M::Error> where M: InvocationMethod<'a, Key, Base>

fn read<'a, Svc>(&'a self) -> Result<ServiceReadGuard<Svc, Base>, LockError<&'static Svc::Key>> where Svc: ServiceReflect, Key: Borrow<Svc::Key>, Base: Downcast<Svc>

Shortcut for .invoke::<ioc::Read<{Svc}>>(()).

fn write<'a, Svc>(&'a self) -> Result<ServiceWriteGuard<Svc, Base>, LockError<&'static Svc::Key>> where Svc: ServiceReflect, Key: Borrow<Svc::Key>, Base: Downcast<Svc>

Shortcut for .invoke::<ioc::Write<{Svc}>>(()).

fn create<'a, Obj>(&'a self, args: Obj::Factory::Args) -> Result<Obj, CreationError<&'static Obj::Factory::Key, Obj::Factory::Error>> where Obj: FactoryObject, Obj::Factory: ServiceReflect, Key: Borrow<Obj::Factory::Key>, Base: Downcast<Obj::Factory>

Shortcut for .invoke::<ioc::Create<{Obj}>>(args).

fn read_all(&self) -> Result<ServiceReadGuardMap<Key, Base>, LockError<&Key>>

Shortcut for .invoke::<ioc::ReadAll>(()).

fn write_all(&self) -> Result<ServiceWriteGuardMap<Key, Base>, LockError<&Key>>

Shortcut for .invoke::<ioc::WriteAll>(()).