pub struct ReconnectionParams {
pub initial_delay: Duration,
pub max_delay: Duration,
pub backoff_factor: f64,
pub max_attempts: usize,
pub attempt: usize,
}Expand description
Reconnection parameters
Fields§
§initial_delay: DurationInitial delay before reconnection attempt
max_delay: DurationMaximum delay between reconnection attempts
backoff_factor: f64Backoff factor for exponential backoff
max_attempts: usizeMaximum number of reconnection attempts
attempt: usizeCurrent reconnection attempt
Implementations§
Source§impl ReconnectionParams
impl ReconnectionParams
Sourcepub fn next_delay(&self) -> Duration
pub fn next_delay(&self) -> Duration
Calculate the next delay based on the current attempt
Sourcepub const fn is_max_attempts_reached(&self) -> bool
pub const fn is_max_attempts_reached(&self) -> bool
Check if maximum attempts reached
Trait Implementations§
Source§impl Clone for ReconnectionParams
impl Clone for ReconnectionParams
Source§fn clone(&self) -> ReconnectionParams
fn clone(&self) -> ReconnectionParams
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReconnectionParams
impl Debug for ReconnectionParams
Auto Trait Implementations§
impl Freeze for ReconnectionParams
impl RefUnwindSafe for ReconnectionParams
impl Send for ReconnectionParams
impl Sync for ReconnectionParams
impl Unpin for ReconnectionParams
impl UnwindSafe for ReconnectionParams
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