pub struct WebSocketConfig {
pub reconnect_enabled: bool,
pub reconnect_max_attempts: u32,
pub reconnect_base_delay_ms: u64,
pub reconnect_max_delay_ms: u64,
pub ping_interval_ms: u64,
pub message_buffer_size: usize,
pub connection_timeout_ms: u64,
}Expand description
Configuration for WebSocket connections.
Fields§
§reconnect_enabled: boolWhether automatic reconnection is enabled.
reconnect_max_attempts: u32Maximum number of reconnection attempts.
reconnect_base_delay_ms: u64Base delay between reconnection attempts in milliseconds.
reconnect_max_delay_ms: u64Maximum delay between reconnection attempts in milliseconds.
ping_interval_ms: u64Interval for sending ping messages in milliseconds.
message_buffer_size: usizeSize of the message buffer.
connection_timeout_ms: u64Connection timeout in milliseconds.
Implementations§
Source§impl WebSocketConfig
impl WebSocketConfig
Sourcepub fn no_reconnect(self) -> Self
pub fn no_reconnect(self) -> Self
Disable automatic reconnection.
Sourcepub fn max_reconnect_attempts(self, attempts: u32) -> Self
pub fn max_reconnect_attempts(self, attempts: u32) -> Self
Set maximum reconnection attempts.
Sourcepub fn reconnect_base_delay(self, delay_ms: u64) -> Self
pub fn reconnect_base_delay(self, delay_ms: u64) -> Self
Set base delay for reconnection in milliseconds.
Sourcepub fn ping_interval(self, interval_ms: u64) -> Self
pub fn ping_interval(self, interval_ms: u64) -> Self
Set ping interval in milliseconds.
Sourcepub fn buffer_size(self, size: usize) -> Self
pub fn buffer_size(self, size: usize) -> Self
Set message buffer size.
Sourcepub fn connection_timeout(self, timeout_ms: u64) -> Self
pub fn connection_timeout(self, timeout_ms: u64) -> Self
Set connection timeout in milliseconds.
Trait Implementations§
Source§impl Clone for WebSocketConfig
impl Clone for WebSocketConfig
Source§fn clone(&self) -> WebSocketConfig
fn clone(&self) -> WebSocketConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 WebSocketConfig
impl Debug for WebSocketConfig
Auto Trait Implementations§
impl Freeze for WebSocketConfig
impl RefUnwindSafe for WebSocketConfig
impl Send for WebSocketConfig
impl Sync for WebSocketConfig
impl Unpin for WebSocketConfig
impl UnwindSafe for WebSocketConfig
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