Struct ioc::Container
[−]
[src]
pub struct Container<Key, SvcBase: ?Sized> { /* fields omitted */ }
Methods
impl<Key, SvcBase: ?Sized> Container<Key, SvcBase> where
Key: Key,
SvcBase: Any,
[src]
Key: Key,
SvcBase: Any,
fn services(&self) -> &BTreeMap<Key, RwLock<Box<SvcBase>>>
fn get_service(&self, key: &Key) -> Option<&RwLock<Box<SvcBase>>>
fn read_service_base<'a>(
&'a self,
key: &'a Key
) -> Result<RwLockReadGuard<Box<SvcBase>>, Error<'a, Key>>
&'a self,
key: &'a Key
) -> Result<RwLockReadGuard<Box<SvcBase>>, Error<'a, Key>>
fn write_service_base<'a>(
&'a self,
key: &'a Key
) -> Result<RwLockWriteGuard<Box<SvcBase>>, Error<'a, Key>>
&'a self,
key: &'a Key
) -> Result<RwLockWriteGuard<Box<SvcBase>>, Error<'a, Key>>
fn read_service<'a, Svc>(
&'a self,
key: &'a Key
) -> Result<ReadGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Any,
SvcBase: Downcast<Svc>,
&'a self,
key: &'a Key
) -> Result<ReadGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Any,
SvcBase: Downcast<Svc>,
fn write_service<'a, Svc>(
&'a self,
key: &'a Key
) -> Result<WriteGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Any,
SvcBase: Downcast<Svc>,
&'a self,
key: &'a Key
) -> Result<WriteGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Any,
SvcBase: Downcast<Svc>,
fn read<'a, Svc>(&'a self) -> Result<ReadGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Service<Key = Key>,
SvcBase: Downcast<Svc>,
Svc: Service<Key = Key>,
SvcBase: Downcast<Svc>,
fn write<'a, Svc>(&'a self) -> Result<WriteGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Service<Key = Key>,
SvcBase: Downcast<Svc>,
Svc: Service<Key = Key>,
SvcBase: Downcast<Svc>,
fn try_read_service_base<'a>(
&'a self,
key: &'a Key
) -> Result<RwLockReadGuard<Box<SvcBase>>, Error<'a, Key>>
&'a self,
key: &'a Key
) -> Result<RwLockReadGuard<Box<SvcBase>>, Error<'a, Key>>
fn try_write_service_base<'a>(
&'a self,
key: &'a Key
) -> Result<RwLockWriteGuard<Box<SvcBase>>, Error<'a, Key>>
&'a self,
key: &'a Key
) -> Result<RwLockWriteGuard<Box<SvcBase>>, Error<'a, Key>>
fn try_read_service<'a, Svc>(
&'a self,
key: &'a Key
) -> Result<ReadGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Any,
SvcBase: Downcast<Svc>,
&'a self,
key: &'a Key
) -> Result<ReadGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Any,
SvcBase: Downcast<Svc>,
fn try_write_service<'a, Svc>(
&'a self,
key: &'a Key
) -> Result<WriteGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Any,
SvcBase: Downcast<Svc>,
&'a self,
key: &'a Key
) -> Result<WriteGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Any,
SvcBase: Downcast<Svc>,
fn try_read<'a, Svc>(
&'a self
) -> Result<ReadGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Service<Key = Key>,
SvcBase: Downcast<Svc>,
&'a self
) -> Result<ReadGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Service<Key = Key>,
SvcBase: Downcast<Svc>,
fn try_write<'a, Svc>(
&'a self
) -> Result<WriteGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Service<Key = Key>,
SvcBase: Downcast<Svc>,
&'a self
) -> Result<WriteGuard<Svc, SvcBase>, Error<'a, Key>> where
Svc: Service<Key = Key>,
SvcBase: Downcast<Svc>,
fn resolve<'a, M>(&'a self) -> Result<M::Ret, Error<Key>> where
M: Method<'a, Key, SvcBase>,
M: Method<'a, Key, SvcBase>,
fn try_resolve<'a, M>(&'a self) -> Result<M::Ret, Error<Key>> where
M: Method<'a, Key, SvcBase>,
M: Method<'a, Key, SvcBase>,