pub struct ExponentialBackoffWithJitter {
pub max_wait: Duration,
pub max_reconnect_attempts: Option<u32>,
}
Expand description
A reconnect policy that will exponentially backoff the the delay between reconnect attempts.
Reconnects will range from 128ms to the specified max wait time, before applying jitter.
Fields§
§max_wait: Duration
The longest possible time to wait between reconnect attempts.
max_reconnect_attempts: Option<u32>
The max number of reconnect attempts before giving up.
Trait Implementations§
Source§impl Clone for ExponentialBackoffWithJitter
impl Clone for ExponentialBackoffWithJitter
Source§fn clone(&self) -> ExponentialBackoffWithJitter
fn clone(&self) -> ExponentialBackoffWithJitter
Returns a copy 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 ReconnectPolicy for ExponentialBackoffWithJitter
impl ReconnectPolicy for ExponentialBackoffWithJitter
Source§fn next_reconnect_delay(
&self,
attempt_count: u32,
error: &ConnectionError,
) -> Option<Duration>
fn next_reconnect_delay( &self, attempt_count: u32, error: &ConnectionError, ) -> Option<Duration>
Get the next reconnect delay.
Returns None if no reconnect should be attempted.
Auto Trait Implementations§
impl Freeze for ExponentialBackoffWithJitter
impl RefUnwindSafe for ExponentialBackoffWithJitter
impl Send for ExponentialBackoffWithJitter
impl Sync for ExponentialBackoffWithJitter
impl Unpin for ExponentialBackoffWithJitter
impl UnwindSafe for ExponentialBackoffWithJitter
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