pub struct RetryPolicy {
pub max_retries: u32,
pub initial_backoff: Duration,
pub max_backoff: Duration,
pub unhealthy_backoff: Duration,
}Expand description
Retry behavior for transient request failures.
Carried by Client as its inner state: construct one and pass it to
Client::new / Client::new_with_client.
Fields§
§max_retries: u32Retries after the initial attempt. 3 means up to 4 attempts total;
0 disables retrying.
initial_backoff: DurationWait before the first retry. Each further retry doubles the wait.
max_backoff: DurationUpper bound on the wait between attempts.
unhealthy_backoff: DurationFlat wait between 502 retries while the cluster reports unhealthy on
/v0/cluster_healthz: the cluster is likely upgrading or restarting,
so a flat pause beats an exponential ramp. Not capped by
max_backoff.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Trait Implementations§
Source§impl ClientHooks<RetryPolicy> for &Client
impl ClientHooks<RetryPolicy> for &Client
Source§async fn pre<E>(
&self,
request: &mut Request,
info: &OperationInfo,
) -> Result<(), Error<E>>
async fn pre<E>( &self, request: &mut Request, info: &OperationInfo, ) -> Result<(), Error<E>>
Runs prior to the execution of the request. This may be used to modify
the request before it is transmitted.
Source§impl ClientHooks<RetryPolicy> for Client
Route every request through the retry layer. Overrides the no-op default
on &Client via auto-ref specialization (see progenitor_client::ClientHooks).
impl ClientHooks<RetryPolicy> for Client
Route every request through the retry layer. Overrides the no-op default
on &Client via auto-ref specialization (see progenitor_client::ClientHooks).
Source§async fn exec(&self, request: Request, info: &OperationInfo) -> Result<Response>
async fn exec(&self, request: Request, info: &OperationInfo) -> Result<Response>
Execute the request. Note that for almost any reasonable implementation
this will include code equivalent to this: Read more
Source§impl ClientInfo<RetryPolicy> for Client
impl ClientInfo<RetryPolicy> for Client
Source§fn api_version() -> &'static str
fn api_version() -> &'static str
Get the version of this API. Read more
Source§fn inner(&self) -> &RetryPolicy
fn inner(&self) -> &RetryPolicy
Get the inner value of type
T if one is specified.Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
Source§fn clone(&self) -> RetryPolicy
fn clone(&self) -> RetryPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
impl Eq for RetryPolicy
Source§impl PartialEq for RetryPolicy
impl PartialEq for RetryPolicy
impl StructuralPartialEq for RetryPolicy
Auto Trait Implementations§
impl Freeze for RetryPolicy
impl RefUnwindSafe for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin for RetryPolicy
impl UnsafeUnpin for RetryPolicy
impl UnwindSafe for RetryPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.