pub struct ReconnectConfig {
pub enabled: bool,
pub initial_delay_ms: u64,
pub max_delay_ms: u64,
pub backoff_multiplier: f64,
pub max_attempts: usize,
}Expand description
Reconnect configuration
Defines the automatic reconnection strategy after a WebSocket disconnect
Fields§
§enabled: boolEnables or disables automatic reconnection
initial_delay_ms: u64Initial reconnection delay in milliseconds
max_delay_ms: u64Maximum reconnection delay in milliseconds
backoff_multiplier: f64Exponential backoff multiplier
max_attempts: usizeMaximum number of reconnection attempts (0 means unlimited)
Implementations§
Source§impl ReconnectConfig
impl ReconnectConfig
Sourcepub fn calculate_delay(&self, attempt: usize) -> u64
pub fn calculate_delay(&self, attempt: usize) -> u64
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