pub struct ServiceRegistry { /* private fields */ }Expand description
Host-side registry of all registered services.
Stores services registered by plugins and provides access by domain name.
Implementations§
Source§impl ServiceRegistry
impl ServiceRegistry
Sourcepub fn register(
&mut self,
domain: &str,
service: Box<dyn Service>,
) -> Result<(), ServiceError>
pub fn register( &mut self, domain: &str, service: Box<dyn Service>, ) -> Result<(), ServiceError>
Register a service under the given domain name.
Returns an error if the domain is already taken.
Sourcepub fn get(&self, domain: &str) -> Result<&dyn Service, ServiceError>
pub fn get(&self, domain: &str) -> Result<&dyn Service, ServiceError>
Get a reference to a service by domain name.
Trait Implementations§
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 !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