pub struct WebSocketOptions {
pub ping_interval: Duration,
pub pong_timeout: Duration,
pub base_reconnect_delay: Duration,
pub max_reconnect_delay: Duration,
pub connection_lifetime: Duration,
pub takeover: bool,
pub on_close: Option<Arc<dyn Fn(u16, &str) + Send + Sync>>,
}Expand description
Tunes the streaming clients. The defaults match the sibling clients.
Fields§
§ping_interval: DurationApplication-level ping cadence, default 25s.
pong_timeout: DurationForce reconnect when no pong arrives within this window, default 60s.
base_reconnect_delay: DurationFirst reconnect backoff, default 500ms.
max_reconnect_delay: DurationBackoff cap, default 10s.
connection_lifetime: DurationProactive connection rotation, default 115min (under the 2h server cap).
takeover: boolTake over an existing connection for the same key.
on_close: Option<Arc<dyn Fn(u16, &str) + Send + Sync>>Called with (code, reason) whenever a connection closes.
Trait Implementations§
Source§impl Clone for WebSocketOptions
impl Clone for WebSocketOptions
Source§fn clone(&self) -> WebSocketOptions
fn clone(&self) -> WebSocketOptions
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 WebSocketOptions
impl Debug for WebSocketOptions
Auto Trait Implementations§
impl !RefUnwindSafe for WebSocketOptions
impl !UnwindSafe for WebSocketOptions
impl Freeze for WebSocketOptions
impl Send for WebSocketOptions
impl Sync for WebSocketOptions
impl Unpin for WebSocketOptions
impl UnsafeUnpin for WebSocketOptions
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