pub struct ClientConfig {
pub receive_timeout: Duration,
pub exit_on_first_failure: bool,
pub connect_timeout: Duration,
pub handshake_retry_delay: Duration,
pub ws_config: Option<WebSocketConfig>,
pub disable_nagle: bool,
pub channel_buffer_size: usize,
pub send_queue_capacity: usize,
pub processor_error_policy: ProcessorErrorPolicy,
}Expand description
Configuration for the WebSocket client
Fields§
§receive_timeout: DurationReceive timeout - disconnect if no message received within this duration
exit_on_first_failure: boolWhether to exit immediately if the first connection fails
connect_timeout: DurationConnection timeout for establishing TCP/WebSocket
handshake_retry_delay: DurationDelay before retrying after handshake failures
ws_config: Option<WebSocketConfig>WebSocket protocol configuration
disable_nagle: boolDisable Nagle’s algorithm for lower latency
channel_buffer_size: usizeChannel buffer size for message broadcasting
send_queue_capacity: usizeOutgoing send queue capacity (bounded channel for backpressure)
processor_error_policy: ProcessorErrorPolicyPolicy for handling extension processor errors
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub const fn with_receive_timeout(self, timeout: Duration) -> Self
pub const fn with_receive_timeout(self, timeout: Duration) -> Self
Set the receive timeout
Sourcepub const fn with_exit_on_first_failure(self, exit: bool) -> Self
pub const fn with_exit_on_first_failure(self, exit: bool) -> Self
Set whether to exit on first connection failure
Sourcepub const fn with_connect_timeout(self, timeout: Duration) -> Self
pub const fn with_connect_timeout(self, timeout: Duration) -> Self
Set connect timeout
Sourcepub const fn with_handshake_retry_delay(self, delay: Duration) -> Self
pub const fn with_handshake_retry_delay(self, delay: Duration) -> Self
Set handshake retry delay
Sourcepub fn with_ws_config(self, config: WebSocketConfig) -> Self
pub fn with_ws_config(self, config: WebSocketConfig) -> Self
Set WebSocket protocol configuration
Sourcepub const fn with_nodelay(self, nodelay: bool) -> Self
pub const fn with_nodelay(self, nodelay: bool) -> Self
Disable Nagle’s algorithm
Sourcepub const fn with_channel_buffer(self, size: usize) -> Self
pub const fn with_channel_buffer(self, size: usize) -> Self
Set channel buffer size
Sourcepub const fn with_send_queue_capacity(self, cap: usize) -> Self
pub const fn with_send_queue_capacity(self, cap: usize) -> Self
Set bounded send queue capacity (for backpressure)
Sourcepub const fn with_processor_error_policy(
self,
policy: ProcessorErrorPolicy,
) -> Self
pub const fn with_processor_error_policy( self, policy: ProcessorErrorPolicy, ) -> Self
Set processor error handling policy for message extensions
Sourcepub const fn fast_reconnect() -> Self
pub const fn fast_reconnect() -> Self
Preset: Fast reconnection for low-latency scenarios
Sourcepub const fn stable_connection() -> Self
pub const fn stable_connection() -> Self
Preset: Stable connection for long-running scenarios
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more