pub struct WebSocketConfig {
pub ws_url: Url,
pub heartbeat_interval: Duration,
pub max_reconnect_attempts: u32,
pub reconnect_delay: Duration,
pub connection_timeout: Duration,
pub enable_logging: bool,
pub log_level: String,
pub test_mode: bool,
pub client_id: Option<String>,
pub client_secret: Option<String>,
}Expand description
WebSocket client configuration
Fields§
§ws_url: UrlWebSocket URL
heartbeat_interval: DurationHeartbeat interval
max_reconnect_attempts: u32Maximum reconnection attempts
reconnect_delay: DurationReconnection delay
connection_timeout: DurationConnection timeout
enable_logging: boolEnable logging
log_level: StringLog level
test_mode: boolTest mode
client_id: Option<String>Client ID for authentication
client_secret: Option<String>Client secret for authentication
Implementations§
Source§impl WebSocketConfig
impl WebSocketConfig
Sourcepub fn with_url(url: &str) -> Result<Self, ParseError>
pub fn with_url(url: &str) -> Result<Self, ParseError>
Create a new configuration with custom URL
Sourcepub fn with_heartbeat_interval(self, interval: Duration) -> Self
pub fn with_heartbeat_interval(self, interval: Duration) -> Self
Set heartbeat interval
Sourcepub fn with_max_reconnect_attempts(self, attempts: u32) -> Self
pub fn with_max_reconnect_attempts(self, attempts: u32) -> Self
Set maximum reconnection attempts
Sourcepub fn with_reconnect_delay(self, delay: Duration) -> Self
pub fn with_reconnect_delay(self, delay: Duration) -> Self
Set reconnection delay
Sourcepub fn with_connection_timeout(self, timeout: Duration) -> Self
pub fn with_connection_timeout(self, timeout: Duration) -> Self
Set connection timeout
Sourcepub fn with_credentials(self, client_id: String, client_secret: String) -> Self
pub fn with_credentials(self, client_id: String, client_secret: String) -> Self
Set client credentials
Sourcepub fn with_client_id(self, client_id: String) -> Self
pub fn with_client_id(self, client_id: String) -> Self
Set client ID
Sourcepub fn with_client_secret(self, client_secret: String) -> Self
pub fn with_client_secret(self, client_secret: String) -> Self
Set client secret
Sourcepub fn with_logging(self, enable: bool) -> Self
pub fn with_logging(self, enable: bool) -> Self
Enable or disable logging
Sourcepub fn with_log_level(self, level: String) -> Self
pub fn with_log_level(self, level: String) -> Self
Set log level
Sourcepub fn with_test_mode(self, test_mode: bool) -> Self
pub fn with_test_mode(self, test_mode: bool) -> Self
Set test mode
Sourcepub fn has_credentials(&self) -> bool
pub fn has_credentials(&self) -> bool
Check if credentials are available
Sourcepub fn get_credentials(&self) -> Option<(&str, &str)>
pub fn get_credentials(&self) -> Option<(&str, &str)>
Get client credentials as tuple
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