pub struct ProtocolManager { /* private fields */ }Expand description
Manager for all discovery protocols
Implementations§
Source§impl ProtocolManager
impl ProtocolManager
Sourcepub async fn new(config: DiscoveryConfig) -> Result<Self>
pub async fn new(config: DiscoveryConfig) -> Result<Self>
Create a new protocol manager
Sourcepub fn protocol_types(&self) -> Vec<ProtocolType>
pub fn protocol_types(&self) -> Vec<ProtocolType>
Get enabled protocol types
Sourcepub async fn discover_services(
&self,
service_types: Vec<ServiceType>,
timeout: Option<Duration>,
) -> Result<Vec<ServiceInfo>>
pub async fn discover_services( &self, service_types: Vec<ServiceType>, timeout: Option<Duration>, ) -> Result<Vec<ServiceInfo>>
Discover services with all enabled protocols
Sourcepub async fn discover_services_with_protocol(
&self,
protocol_type: ProtocolType,
service_types: Vec<ServiceType>,
timeout: Option<Duration>,
) -> Result<Vec<ServiceInfo>>
pub async fn discover_services_with_protocol( &self, protocol_type: ProtocolType, service_types: Vec<ServiceType>, timeout: Option<Duration>, ) -> Result<Vec<ServiceInfo>>
Discover services with a specific protocol
Sourcepub async fn register_service(&self, service: ServiceInfo) -> Result<()>
pub async fn register_service(&self, service: ServiceInfo) -> Result<()>
Register a service with the appropriate protocol
Sourcepub async fn unregister_service(&self, service: &ServiceInfo) -> Result<()>
pub async fn unregister_service(&self, service: &ServiceInfo) -> Result<()>
Unregister a service
Sourcepub async fn verify_service(&self, service: &ServiceInfo) -> Result<bool>
pub async fn verify_service(&self, service: &ServiceInfo) -> Result<bool>
Verify a service is still available
Sourcepub fn protocols(
&self,
) -> &HashMap<ProtocolType, Arc<dyn DiscoveryProtocol + Send + Sync>>
pub fn protocols( &self, ) -> &HashMap<ProtocolType, Arc<dyn DiscoveryProtocol + Send + Sync>>
Get a reference to the protocols map
Sourcepub async fn health_check(&self) -> HashMap<ProtocolType, bool>
pub async fn health_check(&self) -> HashMap<ProtocolType, bool>
Perform a health check on all protocols
Trait Implementations§
Source§impl Clone for ProtocolManager
impl Clone for ProtocolManager
Source§fn clone(&self) -> ProtocolManager
fn clone(&self) -> ProtocolManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ProtocolManager
impl !RefUnwindSafe for ProtocolManager
impl Send for ProtocolManager
impl Sync for ProtocolManager
impl Unpin for ProtocolManager
impl !UnwindSafe for ProtocolManager
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