pub struct WebSocketConfig {
pub url: Option<String>,
pub reconnect_attempts: u32,
pub reconnect_interval: Duration,
}Expand description
Configuration for WebSocket connection
Fields§
§url: Option<String>WebSocket URL to connect to (None means auto-generate in auto-start mode)
reconnect_attempts: u32Number of reconnect attempts
reconnect_interval: DurationInterval between reconnect attempts
Implementations§
Source§impl WebSocketConfig
impl WebSocketConfig
Sourcepub fn new(url: String) -> Self
pub fn new(url: String) -> Self
Create a new WebSocketConfig with the specified URL and default reconnect settings
Sourcepub fn auto_start() -> Self
pub fn auto_start() -> Self
Create a new WebSocketConfig for auto-start mode (URL will be auto-generated)
Sourcepub fn with_reconnect_settings(
url: String,
reconnect_attempts: u32,
reconnect_interval: Duration,
) -> Self
pub fn with_reconnect_settings( url: String, reconnect_attempts: u32, reconnect_interval: Duration, ) -> Self
Create a new WebSocketConfig with custom reconnect settings
Sourcepub fn auto_start_with_reconnect_settings(
reconnect_attempts: u32,
reconnect_interval: Duration,
) -> Self
pub fn auto_start_with_reconnect_settings( reconnect_attempts: u32, reconnect_interval: Duration, ) -> Self
Create a new WebSocketConfig for auto-start mode with custom reconnect settings
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