pub struct Config {
pub url: String,
pub command_queue_size: usize,
pub event_queue_size: usize,
pub max_reconnect_attempts: u32,
pub reconnect_base_delay: Duration,
pub reconnect_max_delay: Duration,
pub close_timeout: Duration,
pub ping_interval: Duration,
pub pong_timeout: Duration,
pub connection_ttl: Duration,
}Fields§
§url: StringWebSocket server URL
command_queue_size: usizeMaximum number of pending commands (backpressure)
event_queue_size: usizeMaximum number of buffered events (backpressure)
max_reconnect_attempts: u32Maximum reconnect attempts (0 = no reconnect)
reconnect_base_delay: DurationBase delay between reconnect attempts
reconnect_max_delay: DurationMaximum delay cap for exponential back-off
close_timeout: DurationHow long to wait for a clean close handshake
ping_interval: DurationExpected interval between heartbeat pings from the server. Per Binance Spot docs, the server sends a ping every 20s. Used as the initial deadline for the first server ping; if exceeded, the connection is assumed dead and a reconnect is scheduled.
pong_timeout: DurationMaximum time to wait for the next ping after we last responded with a pong before declaring the connection dead. Per Binance Spot docs, the server disconnects if no pong is received within 60s.
connection_ttl: DurationMaximum lifetime of a single websocket connection before a proactive reconnect. Per Binance Spot docs, a connection is only valid for 24h.