Struct ioc::StagedIoc [] [src]

pub struct StagedIoc<Key, SvcLock> {
    // some fields omitted
}

Methods

impl<Key, SvcLock> StagedIoc<Key, SvcLock> where Key: Key
[src]

fn get_stage(&self, key: &Key) -> Option<&Ioc<Key, SvcLock>>

fn get_service(&self, key: &Key) -> Option<&SvcLock>

Trait Implementations

impl<'a, Key, SvcBase: ?Sized> Container<'a> for StagedIoc<Key, RwLock<Box<SvcBase>>> where Key: Key, SvcBase: Any
[src]

type Key = Key

type ServiceBase = SvcBase

type ReadGuardBase = RwLockReadGuard<'a, Box<SvcBase>>

type WriteGuardBase = RwLockWriteGuard<'a, Box<SvcBase>>

fn read_service_base(&'a self, key: &'a Self::Key) -> Result<Self::ReadGuardBase, Error<'a, Self::Key>>

fn write_service_base(&'a self, key: &'a Self::Key) -> Result<Self::WriteGuardBase, Error<'a, Self::Key>>

fn read_all(&'a self) -> Result<BTreeMap<&'a Self::Key, Self::ReadGuardBase>, Error<'a, Self::Key>>

fn write_all(&'a self) -> Result<BTreeMap<&'a Self::Key, Self::WriteGuardBase>, Error<'a, Self::Key>>

fn read_service<Svc>(&'a self, key: &'a Self::Key) -> Result<ReadGuard<Svc, Self::ServiceBase, Self::ReadGuardBase>, Error<'a, Self::Key>> where Svc: Any, Self::ServiceBase: Downcast<Svc>

fn write_service<Svc>(&'a self, key: &'a Self::Key) -> Result<WriteGuard<Svc, Self::ServiceBase, Self::WriteGuardBase>, Error<'a, Self::Key>> where Svc: Any, Self::ServiceBase: Downcast<Svc>

fn read<Svc>(&'a self) -> Result<ReadGuard<Svc, Self::ServiceBase, Self::ReadGuardBase>, Error<'a, Self::Key>> where Svc: Service<Key=Self::Key>, Self::ServiceBase: Downcast<Svc>

fn write<Svc>(&'a self) -> Result<WriteGuard<Svc, Self::ServiceBase, Self::WriteGuardBase>, Error<'a, Self::Key>> where Svc: Service<Key=Self::Key>, Self::ServiceBase: Downcast<Svc>

fn create_factory_object<Obj, Svc>(&'a self, svc: &'a Self::Key) -> Result<Obj, Error<'a, Self::Key>> where Svc: FactoryBase<'a, Self, Obj>, Self::ServiceBase: Downcast<Svc>

fn create<Obj>(&'a self) -> Result<Obj, Error<'a, Self::Key>> where Obj: FactoryObject<Key=Self::Key>, Obj::Factory: FactoryBase<'a, Self, Obj>, Self::ServiceBase: Downcast<Obj::Factory>

fn resolve<M>(&'a self) -> Result<M::Ret, Error<'a, Self::Key>> where M: Method<'a, Self>

impl<'a, Key, SvcBase: ?Sized> Container<'a> for StagedIoc<Key, RefCell<Box<SvcBase>>> where Key: Key, SvcBase: Any
[src]

type Key = Key

type ServiceBase = SvcBase

type ReadGuardBase = Ref<'a, Box<SvcBase>>

type WriteGuardBase = RefMut<'a, Box<SvcBase>>

fn read_service_base(&'a self, key: &'a Self::Key) -> Result<Self::ReadGuardBase, Error<'a, Self::Key>>

fn write_service_base(&'a self, key: &'a Self::Key) -> Result<Self::WriteGuardBase, Error<'a, Self::Key>>

fn read_all(&'a self) -> Result<BTreeMap<&'a Self::Key, Self::ReadGuardBase>, Error<'a, Self::Key>>

fn write_all(&'a self) -> Result<BTreeMap<&'a Self::Key, Self::WriteGuardBase>, Error<'a, Self::Key>>

fn read_service<Svc>(&'a self, key: &'a Self::Key) -> Result<ReadGuard<Svc, Self::ServiceBase, Self::ReadGuardBase>, Error<'a, Self::Key>> where Svc: Any, Self::ServiceBase: Downcast<Svc>

fn write_service<Svc>(&'a self, key: &'a Self::Key) -> Result<WriteGuard<Svc, Self::ServiceBase, Self::WriteGuardBase>, Error<'a, Self::Key>> where Svc: Any, Self::ServiceBase: Downcast<Svc>

fn read<Svc>(&'a self) -> Result<ReadGuard<Svc, Self::ServiceBase, Self::ReadGuardBase>, Error<'a, Self::Key>> where Svc: Service<Key=Self::Key>, Self::ServiceBase: Downcast<Svc>

fn write<Svc>(&'a self) -> Result<WriteGuard<Svc, Self::ServiceBase, Self::WriteGuardBase>, Error<'a, Self::Key>> where Svc: Service<Key=Self::Key>, Self::ServiceBase: Downcast<Svc>

fn create_factory_object<Obj, Svc>(&'a self, svc: &'a Self::Key) -> Result<Obj, Error<'a, Self::Key>> where Svc: FactoryBase<'a, Self, Obj>, Self::ServiceBase: Downcast<Svc>

fn create<Obj>(&'a self) -> Result<Obj, Error<'a, Self::Key>> where Obj: FactoryObject<Key=Self::Key>, Obj::Factory: FactoryBase<'a, Self, Obj>, Self::ServiceBase: Downcast<Obj::Factory>

fn resolve<M>(&'a self) -> Result<M::Ret, Error<'a, Self::Key>> where M: Method<'a, Self>

impl<'a, Key, SvcBase: ?Sized> StagedContainer<'a> for StagedIoc<Key, RwLock<Box<SvcBase>>> where Key: Key, SvcBase: Any
[src]

type Stage = Ioc<Key, RwLock<Box<SvcBase>>>

type StageIter = StageIter<'a, Key, RwLock<Box<SvcBase>>>

fn stages(&'a self) -> Self::StageIter

impl<'a, Key, SvcBase: ?Sized> StagedContainer<'a> for StagedIoc<Key, RefCell<Box<SvcBase>>> where Key: Key, SvcBase: Any
[src]

type Stage = Ioc<Key, RefCell<Box<SvcBase>>>

type StageIter = StageIter<'a, Key, RefCell<Box<SvcBase>>>

fn stages(&'a self) -> Self::StageIter