pub struct Scope { /* private fields */ }Implementations§
Source§impl Scope
impl Scope
pub fn get<T: ?Sized + Send + Sync + 'static>(&self) -> Arc<T> ⓘ
pub fn get_optional<T: ?Sized + Send + Sync + 'static>(&self) -> Option<Arc<T>>
Sourcepub fn get_service<T: ?Sized + Send + Sync + 'static>(&self) -> Option<Arc<T>>
pub fn get_service<T: ?Sized + Send + Sync + 'static>(&self) -> Option<Arc<T>>
Alias for get_optional() with MEDI-inspired naming.
Sourcepub fn get_required_service<T: ?Sized + Send + Sync + 'static>(&self) -> Arc<T> ⓘ
pub fn get_required_service<T: ?Sized + Send + Sync + 'static>(&self) -> Arc<T> ⓘ
Alias for get() with MEDI-inspired naming.
Sourcepub fn get_services<T: ?Sized + Send + Sync + 'static>(&self) -> Vec<Arc<T>>
pub fn get_services<T: ?Sized + Send + Sync + 'static>(&self) -> Vec<Arc<T>>
Return all registered instances of the given type. MEDI-inspired naming.
pub fn get_keyed<T: ?Sized + Send + Sync + 'static>(&self, key: &str) -> Arc<T> ⓘ
pub fn get_all<T: ?Sized + Send + Sync + 'static>(&self) -> Vec<Arc<T>>
pub fn get_named_any(&self, name: &str) -> Option<Arc<dyn Any + Send + Sync>>
Trait Implementations§
Source§impl IServiceLocator for Scope
impl IServiceLocator for Scope
Source§impl IServiceResolver for Scope
impl IServiceResolver for Scope
fn get_any(&self, key: &str) -> Option<Arc<dyn Any + Send + Sync>>
fn get_keyed_any( &self, key: &str, variant: &str, ) -> Option<Arc<dyn Any + Send + Sync>>
Source§fn get<T: ?Sized + Sync + Send + 'static>(&self) -> Arc<T> ⓘwhere
Self: Sized,
fn get<T: ?Sized + Sync + Send + 'static>(&self) -> Arc<T> ⓘwhere
Self: Sized,
Resolve a service by type (concrete or
dyn Trait).
Panics if not registered.Source§fn try_get<T: ?Sized + Sync + Send + 'static>(&self) -> Option<Arc<T>>where
Self: Sized,
fn try_get<T: ?Sized + Sync + Send + 'static>(&self) -> Option<Arc<T>>where
Self: Sized,
Resolve a service by type, returning
None if not registered.Auto Trait Implementations§
impl !Freeze for Scope
impl !RefUnwindSafe for Scope
impl !UnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more