pub enum ReconnectPolicy {
Disabled,
Backoff(BackoffConfig),
}Expand description
Automatic retry policy for one connection cycle; defaults to jittered exponential backoff.
Variants§
Disabled
Do not retry failed connections or reconnect after termination.
Backoff(BackoffConfig)
Retry with jittered exponential backoff and count/elapsed-time limits.
Tuple Fields
§
0: BackoffConfigRetry count, delay, and elapsed-time limits for the cycle.
Implementations§
Source§impl ReconnectPolicy
impl ReconnectPolicy
Sourcepub fn long_running() -> Self
pub fn long_running() -> Self
Creates a jittered exponential backoff policy without a retry-count or cycle-elapsed-time limit.
The delay caps remain the safe defaults from BackoffConfig::default,
so an unavailable endpoint does not turn retries into a busy loop. A
session still stops promptly when it is cancelled or closed.
The policy does not change
ConnectOptions::connect_timeout; callers
that also want an unlimited initial connection wait must set that option
to None explicitly.
Trait Implementations§
Source§impl Clone for ReconnectPolicy
impl Clone for ReconnectPolicy
Source§impl Debug for ReconnectPolicy
impl Debug for ReconnectPolicy
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