pub struct ServiceRegistry { /* private fields */ }
Expand description
Service registry for storing discovered services
Implementations§
Source§impl ServiceRegistry
impl ServiceRegistry
pub fn new() -> Self
Sourcepub fn register_service(&mut self, metadata: ServiceMetadata)
pub fn register_service(&mut self, metadata: ServiceMetadata)
Register a service
Sourcepub fn get_service(&self, type_name: &str) -> Option<&ServiceMetadata>
pub fn get_service(&self, type_name: &str) -> Option<&ServiceMetadata>
Get service metadata
Sourcepub fn get_implementations(&self, interface: &str) -> Option<&Vec<String>>
pub fn get_implementations(&self, interface: &str) -> Option<&Vec<String>>
Get all implementations of an interface
Sourcepub fn all_services(&self) -> &HashMap<String, ServiceMetadata>
pub fn all_services(&self) -> &HashMap<String, ServiceMetadata>
Get all registered services
Sourcepub fn apply_conventions(&mut self, conventions: &ServiceConventions)
pub fn apply_conventions(&mut self, conventions: &ServiceConventions)
Apply conventions to fill in missing metadata
Trait Implementations§
Source§impl Debug for ServiceRegistry
impl Debug for ServiceRegistry
Source§impl Default for ServiceRegistry
impl Default for ServiceRegistry
Source§fn default() -> ServiceRegistry
fn default() -> ServiceRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ServiceRegistry
impl RefUnwindSafe for ServiceRegistry
impl Send for ServiceRegistry
impl Sync for ServiceRegistry
impl Unpin for ServiceRegistry
impl UnwindSafe 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