pub struct ReconnectConfig {
pub initial_interval: Duration,
pub max_interval: Duration,
pub multiplier: f64,
pub jitter: f64,
pub max_attempts: Option<u32>,
pub stable_threshold: Duration,
}Expand description
Configuration for automatic reconnection.
Fields§
§initial_interval: DurationInitial backoff interval before first reconnect attempt.
max_interval: DurationMaximum backoff interval — exponential growth is capped here.
multiplier: f64Backoff multiplier (default: 2.0 — doubles each failure).
jitter: f64Random jitter factor 0.0–1.0 added to backoff to avoid thundering herd. e.g. 0.2 adds ±20% random variation.
max_attempts: Option<u32>Maximum number of reconnect attempts before giving up.
None means retry forever.
stable_threshold: DurationHow long a connection must stay up to be considered stable (resets the backoff counter).
Implementations§
Trait Implementations§
Source§impl Clone for ReconnectConfig
impl Clone for ReconnectConfig
Source§fn clone(&self) -> ReconnectConfig
fn clone(&self) -> ReconnectConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 ReconnectConfig
impl Debug for ReconnectConfig
Auto Trait Implementations§
impl Freeze for ReconnectConfig
impl RefUnwindSafe for ReconnectConfig
impl Send for ReconnectConfig
impl Sync for ReconnectConfig
impl Unpin for ReconnectConfig
impl UnsafeUnpin for ReconnectConfig
impl UnwindSafe for ReconnectConfig
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