#[repr(align(32))]pub struct WebSocketConfig {Show 14 fields
pub base_url: String,
pub use_compression: bool,
pub timeout_milliseconds: u64,
pub ping_interval_milliseconds: u64,
pub max_message_size: usize,
pub buffer_size: usize,
pub reconnect: ReconnectStrategy,
pub protocol_version: String,
pub heartbeat_interval_milliseconds: u64,
pub heartbeat_timeout_milliseconds: u64,
pub max_missed_heartbeats: u32,
pub enable_session_failover: bool,
pub failover_urls: Vec<String>,
pub use_zero_copy_parsing: bool,
}Expand description
Optimized WebSocket configuration with performance options
Fields§
§base_url: StringBase URL for WebSocket connections
use_compression: boolWhether to use compression for WebSocket connections
timeout_milliseconds: u64WebSocket connection timeout in milliseconds
ping_interval_milliseconds: u64WebSocket ping interval in milliseconds (0 = disabled)
max_message_size: usizeMaximum message size in bytes (0 = unlimited)
buffer_size: usizeBuffer size for the WebSocket connection
reconnect: ReconnectStrategyReconnect strategy configuration
protocol_version: StringProtocol version to use (if applicable)
heartbeat_interval_milliseconds: u64Heartbeat interval in milliseconds (0 = disabled) This is different from ping_interval_milliseconds as it actively monitors connection health
heartbeat_timeout_milliseconds: u64Heartbeat timeout in milliseconds If no message is received within this time, the connection is considered unhealthy
max_missed_heartbeats: u32Maximum number of consecutive missed heartbeats before considering the connection dead
enable_session_failover: boolWhether to enable session failover
failover_urls: Vec<String>Alternative URLs to connect to if the primary connection fails
use_zero_copy_parsing: boolWhether to use zero-copy JSON parsing for maximum performance This reduces allocations but requires pooled buffers
Trait Implementations§
Source§impl Clone for WebSocketConfig
impl Clone for WebSocketConfig
Source§fn clone(&self) -> WebSocketConfig
fn clone(&self) -> WebSocketConfig
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read more