pub struct DiscoveryComponent { /* private fields */ }Expand description
A lifecycle-managed discovery component.
Implements Component so it can be registered with the application component registry.
On start it creates the provider via the factory, optionally registers the local service instance,
and on stop it deregisters.
Implementations§
Source§impl DiscoveryComponent
impl DiscoveryComponent
Sourcepub fn new(config: DiscoveryConfig) -> Self
pub fn new(config: DiscoveryConfig) -> Self
Create a new discovery component from the given config.
Sourcepub fn with_registry(
config: DiscoveryConfig,
providers: DiscoveryRegistry,
) -> Self
pub fn with_registry( config: DiscoveryConfig, providers: DiscoveryRegistry, ) -> Self
Create a discovery component with an explicit provider registry.
Trait Implementations§
Source§impl Component for DiscoveryComponent
impl Component for DiscoveryComponent
Source§fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AppResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the component. Read more
Auto Trait Implementations§
impl !Freeze for DiscoveryComponent
impl !RefUnwindSafe for DiscoveryComponent
impl !UnwindSafe for DiscoveryComponent
impl Send for DiscoveryComponent
impl Sync for DiscoveryComponent
impl Unpin for DiscoveryComponent
impl UnsafeUnpin for DiscoveryComponent
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