pub struct BridgeConfig {
pub initial_backoff_ms: u64,
pub max_backoff_ms: u64,
pub max_reconnect_attempts: Option<u32>,
}Expand description
Configuration for BridgeClient reconnection behaviour.
Fields§
§initial_backoff_ms: u64Base delay used to compute backoff (milliseconds). Default: 1 000 ms.
The actual wait before retry n (counting from 0 after the most
recent successful connection) is
min(initial_backoff_ms * 2^n, max_backoff_ms).
max_backoff_ms: u64Upper bound on the per-retry backoff delay (milliseconds). Default: 60 000 ms.
max_reconnect_attempts: Option<u32>Maximum number of consecutive failed reconnect attempts before
the relay loop gives up with BridgeError::MaxRetriesExceeded.
The counter resets to zero on every successful WebSocket connect,
so a flaky link can still recover indefinitely as long as it
occasionally succeeds. None (the default) means keep retrying
forever.
Trait Implementations§
Source§impl Clone for BridgeConfig
impl Clone for BridgeConfig
Source§fn clone(&self) -> BridgeConfig
fn clone(&self) -> BridgeConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BridgeConfig
impl Debug for BridgeConfig
Auto Trait Implementations§
impl Freeze for BridgeConfig
impl RefUnwindSafe for BridgeConfig
impl Send for BridgeConfig
impl Sync for BridgeConfig
impl Unpin for BridgeConfig
impl UnsafeUnpin for BridgeConfig
impl UnwindSafe for BridgeConfig
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