pub struct ReconnectConfig {
pub enabled: bool,
pub initial_delay: Duration,
pub max_delay: Duration,
pub backoff_factor_tenths: u32,
pub max_attempts: Option<u32>,
}Fields§
§enabled: bool§initial_delay: Duration§max_delay: Duration§backoff_factor_tenths: u32§max_attempts: Option<u32>Implementations§
Source§impl ReconnectConfig
impl ReconnectConfig
pub fn disabled() -> Self
pub fn backoff_factor(&self) -> f64
pub fn set_backoff_factor(&mut self, factor: f64)
pub fn calculate_delay(&self, attempt: u32) -> Duration
pub fn should_retry(&self, attempt: u32) -> bool
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 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