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§impl Debug for WebSocketOptions
impl Debug for WebSocketOptions
Auto Trait Implementations§
impl !RefUnwindSafe for WebSocketOptions
impl !UnwindSafe for WebSocketOptions
impl Forget for WebSocketOptions
impl Freeze for WebSocketOptions
impl Move for WebSocketOptions
impl Send for WebSocketOptions
impl Sync for WebSocketOptions
impl Unpin for WebSocketOptions
impl UnsafeUnpin for WebSocketOptionswhere
*const ArcInner<dyn Fn(u16, &str) + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(u16, &str) + Sync + Send>>: UnsafeUnpin,
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