pub struct ServiceRegistry { /* private fields */ }Expand description
Registry for discovering and accessing module services
The ServiceRegistry provides:
- Service registration from modules
- Service discovery by ID or pattern
- Health checking for all services
- Module-level service grouping
Implementations§
Source§impl ServiceRegistry
impl ServiceRegistry
Sourcepub async fn register<S: ModuleService + 'static>(&self, service: S)
pub async fn register<S: ModuleService + 'static>(&self, service: S)
Sourcepub async fn register_arc(&self, service: Arc<dyn ModuleService>)
pub async fn register_arc(&self, service: Arc<dyn ModuleService>)
Register a service wrapped in Arc
Sourcepub async fn get(&self, service_id: &str) -> Option<Arc<dyn ModuleService>>
pub async fn get(&self, service_id: &str) -> Option<Arc<dyn ModuleService>>
Get a service by ID
Returns None if the service is not registered.
Sourcepub async fn unregister(&self, service_id: &str) -> bool
pub async fn unregister(&self, service_id: &str) -> bool
Unregister a service
Sourcepub async fn list_by_module(
&self,
module_name: &str,
) -> Vec<Arc<dyn ModuleService>>
pub async fn list_by_module( &self, module_name: &str, ) -> Vec<Arc<dyn ModuleService>>
List services by module
Sourcepub async fn list_by_type(
&self,
service_type: &str,
) -> Vec<Arc<dyn ModuleService>>
pub async fn list_by_type( &self, service_type: &str, ) -> Vec<Arc<dyn ModuleService>>
List services by type
Sourcepub async fn health_check_all(&self) -> RegistryHealth
pub async fn health_check_all(&self) -> RegistryHealth
Health check all services
Sourcepub async fn statistics(&self) -> RegistryStatistics
pub async fn statistics(&self) -> RegistryStatistics
Get registry statistics
Trait Implementations§
Source§impl Clone for ServiceRegistry
impl Clone for ServiceRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for ServiceRegistry
impl !UnwindSafe for ServiceRegistry
impl Freeze for ServiceRegistry
impl Send for ServiceRegistry
impl Sync for ServiceRegistry
impl Unpin for ServiceRegistry
impl UnsafeUnpin for ServiceRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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