#[non_exhaustive]pub struct Reconnect {
pub enabled: bool,
pub base_delay: Duration,
pub max_delay: Duration,
pub factor: f64,
pub jitter: bool,
pub max_attempts: Option<u32>,
}Expand description
How a lost connection is made again.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: boolReconnect at all; without it a lost connection ends the client.
base_delay: DurationThe wait before the first attempt.
max_delay: DurationThe longest wait between attempts.
factor: f64Each attempt waits this many times longer than the one before.
jitter: boolSpread waits by ±10%, so clients of a restarted server do not all come back at once.
max_attempts: Option<u32>Attempts in a row before giving up; None never gives up.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Reconnect
impl Freeze for Reconnect
impl Move for Reconnect
impl RefUnwindSafe for Reconnect
impl Send for Reconnect
impl Sync for Reconnect
impl Unpin for Reconnect
impl UnsafeUnpin for Reconnect
impl UnwindSafe for Reconnect
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