pub struct ReconnectPolicy {
pub enabled: bool,
pub base_backoff: Duration,
pub max_backoff: Duration,
pub max_attempts: Option<u32>,
}Expand description
Reconnection behaviour after an unexpected disconnect or goAway.
Backoff formula: base_backoff × 2^(attempt − 1), capped at max_backoff.
Fields§
§enabled: boolEnable automatic reconnection. Default: true.
base_backoff: DurationInitial backoff delay. Default: 500 ms.
max_backoff: DurationMaximum backoff delay. Default: 5 s.
max_attempts: Option<u32>Maximum reconnection attempts. None = unlimited. Default: Some(10).
Trait Implementations§
Auto Trait Implementations§
impl Freeze 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