pub trait EndpointSubscription: Send + 'static {
type Error: Send + 'static;
// Required methods
fn endpoints(&self) -> Vec<String>;
fn changed(&mut self) -> EndpointChangeFuture<'_, Self::Error>;
// Provided method
fn discovered_endpoints(&self) -> Vec<DiscoveredEndpoint> { ... }
}Expand description
A live, complete snapshot of the endpoints for one logical service.
Discovery backends expose snapshots rather than backend-specific add/remove events so transports can recover consistently after a watch reconnect or a lagged consumer.
Required Associated Types§
Required Methods§
Sourcefn endpoints(&self) -> Vec<String>
fn endpoints(&self) -> Vec<String>
Returns the latest complete endpoint snapshot in stable order.
Sourcefn changed(&mut self) -> EndpointChangeFuture<'_, Self::Error>
fn changed(&mut self) -> EndpointChangeFuture<'_, Self::Error>
Waits until a new complete endpoint snapshot is available.
Provided Methods§
Sourcefn discovered_endpoints(&self) -> Vec<DiscoveredEndpoint>
fn discovered_endpoints(&self) -> Vec<DiscoveredEndpoint>
Returns endpoint metadata when the backend provides it.
Existing discovery implementations remain source-compatible and receive weight 1.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".