pub struct ReconnectPolicy {
pub initial: Duration,
pub max: Duration,
pub max_attempts: Option<u32>,
}Expand description
How the client waits between reconnection attempts.
The delay doubles from initial up to max, and each wait is a random
time between zero and that delay, so many clients reconnecting after a
restart don’t all arrive at once.
Fields§
§initial: DurationThe delay before the first retry.
max: DurationThe longest delay between retries.
max_attempts: Option<u32>Give up after this many attempts in a row; None keeps trying.
Implementations§
Trait Implementations§
Source§impl Clone for ReconnectPolicy
impl Clone for ReconnectPolicy
impl Copy for ReconnectPolicy
Source§impl Debug for ReconnectPolicy
impl Debug for ReconnectPolicy
Source§impl Default for ReconnectPolicy
impl Default for ReconnectPolicy
impl Eq for ReconnectPolicy
Source§impl PartialEq for ReconnectPolicy
impl PartialEq for ReconnectPolicy
impl StructuralPartialEq for ReconnectPolicy
Auto Trait Implementations§
impl Forget for ReconnectPolicy
impl Freeze for ReconnectPolicy
impl Move for ReconnectPolicy
impl RefUnwindSafe for ReconnectPolicy
impl Send for ReconnectPolicy
impl Sync for ReconnectPolicy
impl Unpin for ReconnectPolicy
impl UnsafeUnpin for ReconnectPolicy
impl UnwindSafe for ReconnectPolicy
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