pub struct ProviderRegistry { /* private fields */ }
Expand description
Provider registry manages service providers and their lifecycle
Implementations§
Source§impl ProviderRegistry
impl ProviderRegistry
pub fn new() -> ProviderRegistry
Sourcepub fn register<P>(&mut self, provider: P)where
P: ServiceProvider + 'static,
pub fn register<P>(&mut self, provider: P)where
P: ServiceProvider + 'static,
Register a service provider
Sourcepub fn provider_count(&self) -> usize
pub fn provider_count(&self) -> usize
Get the number of registered providers
Sourcepub fn get_metadata(&self, name: &str) -> Option<&ProviderMetadata>
pub fn get_metadata(&self, name: &str) -> Option<&ProviderMetadata>
Get provider metadata by name
Sourcepub fn resolve_dependencies(&mut self) -> Result<(), ProviderError>
pub fn resolve_dependencies(&mut self) -> Result<(), ProviderError>
Resolve provider dependencies and determine execution order
Sourcepub fn register_all(
&self,
builder: ContainerBuilder,
) -> Result<ContainerBuilder, ProviderError>
pub fn register_all( &self, builder: ContainerBuilder, ) -> Result<ContainerBuilder, ProviderError>
Register all providers with the container builder
Trait Implementations§
Source§impl Default for ProviderRegistry
impl Default for ProviderRegistry
Source§fn default() -> ProviderRegistry
fn default() -> ProviderRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProviderRegistry
impl !RefUnwindSafe for ProviderRegistry
impl Send for ProviderRegistry
impl Sync for ProviderRegistry
impl Unpin for ProviderRegistry
impl !UnwindSafe for ProviderRegistry
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more