pub struct BackoffPolicy {
pub initial_connect_backoff: Duration,
pub max_connect_backoff: Duration,
}Expand description
Capped exponential backoff for SupervisedStream reconnect attempts.
Only consecutive connect failures grow the delay; a successful connect resets it. So an endpoint that keeps refusing is backed off exponentially, while one that recovers is not held to a delay earned by earlier failures.
Fields§
§initial_connect_backoff: DurationDelay before the first reconnect, and the floor a successful connect
resets the growing backoff to. Must be non-zero, else the doubling
(0 * 2 == 0) never grows and reconnects busy-loop.
max_connect_backoff: DurationCap on the delay while backing off. Must be at least initial.
Trait Implementations§
Source§impl Clone for BackoffPolicy
impl Clone for BackoffPolicy
Source§fn clone(&self) -> BackoffPolicy
fn clone(&self) -> BackoffPolicy
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 moreimpl Copy for BackoffPolicy
Auto Trait Implementations§
impl Freeze for BackoffPolicy
impl RefUnwindSafe for BackoffPolicy
impl Send for BackoffPolicy
impl Sync for BackoffPolicy
impl Unpin for BackoffPolicy
impl UnsafeUnpin for BackoffPolicy
impl UnwindSafe for BackoffPolicy
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