pub struct ServiceScope { /* private fields */ }Expand description
服务作用域
Implementations§
Source§impl ServiceScope
impl ServiceScope
Sourcepub fn create_scope(&self) -> DiResult<ServiceScope>
pub fn create_scope(&self) -> DiResult<ServiceScope>
创建嵌套作用域
Sourcepub fn is_disposed(&self) -> bool
pub fn is_disposed(&self) -> bool
检查作用域是否已释放
Trait Implementations§
Source§impl Drop for ServiceScope
impl Drop for ServiceScope
Source§impl ServiceProvider for ServiceScope
impl ServiceProvider for ServiceScope
Source§fn get_service_raw(
&self,
key: &ServiceKey,
) -> DiResult<Option<Arc<dyn Any + Send + Sync>>>
fn get_service_raw( &self, key: &ServiceKey, ) -> DiResult<Option<Arc<dyn Any + Send + Sync>>>
Get the raw implementation of a service
Auto Trait Implementations§
impl Freeze for ServiceScope
impl RefUnwindSafe for ServiceScope
impl Send for ServiceScope
impl Sync for ServiceScope
impl Unpin for ServiceScope
impl UnwindSafe for ServiceScope
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ServiceProviderExt for Twhere
T: ServiceProvider + ?Sized,
impl<T> ServiceProviderExt for Twhere
T: ServiceProvider + ?Sized,
Source§fn get_service<T: 'static + Send + Sync>(&self) -> DiResult<Option<Arc<T>>>
fn get_service<T: 'static + Send + Sync>(&self) -> DiResult<Option<Arc<T>>>
Get a service of the specified type
Source§fn get_required_service<T: 'static + Send + Sync>(&self) -> DiResult<Arc<T>>
fn get_required_service<T: 'static + Send + Sync>(&self) -> DiResult<Arc<T>>
Get a required service of the specified type
Source§fn get_keyed_service<T: 'static + Send + Sync>(
&self,
key: &str,
) -> DiResult<Option<Arc<T>>>
fn get_keyed_service<T: 'static + Send + Sync>( &self, key: &str, ) -> DiResult<Option<Arc<T>>>
Get a service of the specified name and type