ServiceProvider
struct · ferroui-dependency-injection · v0.5.0
struct ServiceProvider
Cloneable handle to a root provider or a scope. Neither Send nor Sync: services stay on the creating thread. Cloning shares state; it never creates a new scope.
Members
same_asis_disposedcreate_scopecreate_async_scopeget_serviceget_required_serviceget_servicesget_keyed_serviceget_required_keyed_serviceget_keyed_servicesdisposedispose_async
same_as
fn same_as(self: &Self, other: &ServiceProvider) -> bool
Whether both handles are the same provider or scope.
is_disposed
fn is_disposed(self: &Self) -> bool
create_scope
fn create_scope(self: &Self) -> ServiceResult<ServiceScope>
create_async_scope
fn create_async_scope(self: &Self) -> ServiceResult<AsyncServiceScope>
get_service
fn get_service<S: ?Sized + 'static>(self: &Self) -> ServiceResult<Option<Rc<S>>>
get_required_service
fn get_required_service<S: ?Sized + 'static>(self: &Self) -> ServiceResult<Rc<S>>
get_services
fn get_services<S: ?Sized + 'static>(self: &Self) -> ServiceResult<Vec<Rc<S>>>
get_keyed_service
fn get_keyed_service<S: ?Sized + 'static>(self: &Self, key: Option<&ServiceKey>) -> ServiceResult<Option<Rc<S>>>
get_required_keyed_service
fn get_required_keyed_service<S: ?Sized + 'static>(self: &Self, key: Option<&ServiceKey>) -> ServiceResult<Rc<S>>
get_keyed_services
fn get_keyed_services<S: ?Sized + 'static>(self: &Self, key: Option<&ServiceKey>) -> ServiceResult<Vec<Rc<S>>>
dispose
fn dispose(self: &Self) -> ServiceResult<()>
Disposes captured services in reverse construction order. Async-only services require
dispose_async; that error leaves the scope active so the caller can retry asynchronously.
dispose_async
fn dispose_async(self: &Self) -> DisposeTask
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeServiceProviderServiceExtensionsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedISupportRequiredServiceCloneIServiceProviderIKeyedServiceProviderIServiceProviderIsServiceIServiceProviderIsKeyedServiceIServiceScopeFactoryIDisposableIAsyncDisposable
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.