pub trait EndpointSource:
Send
+ Sync
+ 'static {
// Required method
fn endpoints(
&self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Endpoint>, ClientError>> + Send + '_>>;
// Provided method
fn refresh_every(&self) -> Option<Duration> { ... }
}Expand description
Where a balanced client’s endpoints come from.
endpoints is asked on the client’s first call and
again once refresh_every has passed since the
last answer, by one caller at a time while the others use the set they
have. An error, or an empty set, keeps the set there was.
Required Methods§
Provided Methods§
Sourcefn refresh_every(&self) -> Option<Duration>
fn refresh_every(&self) -> Option<Duration>
How long an answer holds; None: for ever (the default).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".