pub struct SimpleDiscovery { /* private fields */ }Implementations§
Source§impl SimpleDiscovery
impl SimpleDiscovery
pub fn renew_topic_lease(&mut self, name: &str, ttl: Duration) -> bool
pub fn renew_service_lease(&mut self, name: &str, ttl: Duration) -> bool
pub fn renew_mission_lease(&mut self, name: &str, ttl: Duration) -> bool
pub fn renew_endpoint_lease(&mut self, name: &str, ttl: Duration) -> bool
pub fn set_topic_health(&mut self, name: &str, healthy: bool) -> bool
pub fn set_service_health(&mut self, name: &str, healthy: bool) -> bool
pub fn set_mission_health(&mut self, name: &str, healthy: bool) -> bool
pub fn set_endpoint_health(&mut self, name: &str, healthy: bool) -> bool
pub fn prune_inactive(&mut self) -> DiscoveryPruneReport
pub fn snapshot(&self) -> DiscoverySnapshot
Source§impl SimpleDiscovery
impl SimpleDiscovery
pub fn topic_entries(&self) -> Vec<DiscoveryEntry>
pub fn service_entries(&self) -> Vec<DiscoveryEntry>
pub fn mission_entries(&self) -> Vec<DiscoveryEntry>
pub fn find_topic(&self, name: &str) -> Option<DiscoveryEntry>
pub fn find_endpoint(&self, name: &str) -> Option<DiscoveryEndpoint>
pub fn endpoint_entries(&self) -> Vec<DiscoveryEndpoint>
Source§impl SimpleDiscovery
impl SimpleDiscovery
pub fn register_topic(&mut self, name: impl Into<String>)
pub fn register_service(&mut self, name: impl Into<String>)
pub fn register_mission(&mut self, name: impl Into<String>)
pub fn register_topic_with_ttl( &mut self, name: impl Into<String>, ttl: Duration, )
pub fn register_service_with_ttl( &mut self, name: impl Into<String>, ttl: Duration, )
pub fn register_mission_with_ttl( &mut self, name: impl Into<String>, ttl: Duration, )
pub fn add_labels(&mut self, key: impl Into<String>, labels: Vec<String>)
pub fn register_endpoint(&mut self, name: impl Into<String>, endpoint: Endpoint)
pub fn register_endpoint_with_ttl( &mut self, name: impl Into<String>, endpoint: Endpoint, ttl: Duration, )
pub fn update_endpoint_labels( &mut self, name: &str, labels: Vec<String>, ) -> bool
pub fn unregister_endpoint(&mut self, name: &str) -> bool
Source§impl SimpleDiscovery
impl SimpleDiscovery
Sourcepub fn dump_static_payload(&self) -> String
pub fn dump_static_payload(&self) -> String
Dump current discovery state using static-discovery directives.
Source§impl SimpleDiscovery
impl SimpleDiscovery
Sourcepub fn load_static_payload(&mut self, payload: &str) -> Result<usize, String>
pub fn load_static_payload(&mut self, payload: &str) -> Result<usize, String>
Load static discovery directives from an in-memory string payload.
Sourcepub fn broadcast_static_payload_udp(
&self,
destination: &str,
) -> Result<usize, String>
pub fn broadcast_static_payload_udp( &self, destination: &str, ) -> Result<usize, String>
Broadcast current static discovery payload over UDP in one datagram.
Sourcepub fn receive_static_payload_udp(
&mut self,
bind_addr: &str,
timeout: Duration,
) -> Result<usize, String>
pub fn receive_static_payload_udp( &mut self, bind_addr: &str, timeout: Duration, ) -> Result<usize, String>
Receive one UDP discovery payload and merge it into this registry.
pub fn load_static_file( &mut self, path: impl AsRef<Path>, ) -> Result<usize, String>
Trait Implementations§
Source§impl Default for SimpleDiscovery
impl Default for SimpleDiscovery
Source§fn default() -> SimpleDiscovery
fn default() -> SimpleDiscovery
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SimpleDiscovery
impl RefUnwindSafe for SimpleDiscovery
impl Send for SimpleDiscovery
impl Sync for SimpleDiscovery
impl Unpin for SimpleDiscovery
impl UnsafeUnpin for SimpleDiscovery
impl UnwindSafe for SimpleDiscovery
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