pub struct WsConfig {
pub api_key: Option<String>,
pub api_secret: Option<String>,
pub url: String,
pub ping_interval: u64,
pub max_reconnect_attempts: u32,
pub reconnect_delay: u64,
}Expand description
Configuration for WebSocket client.
Fields§
§api_key: Option<String>API key for private channels
api_secret: Option<String>API secret for private channels
url: StringWebSocket URL
ping_interval: u64Ping interval in seconds
max_reconnect_attempts: u32Maximum reconnection attempts (0 = infinite)
reconnect_delay: u64Reconnection delay in seconds
Implementations§
Source§impl WsConfig
impl WsConfig
Sourcepub fn private(
api_key: impl Into<String>,
api_secret: impl Into<String>,
) -> Self
pub fn private( api_key: impl Into<String>, api_secret: impl Into<String>, ) -> Self
Create a private WebSocket configuration.
Sourcepub fn with_ping_interval(self, interval: u64) -> Self
pub fn with_ping_interval(self, interval: u64) -> Self
Set the ping interval in seconds.
Sourcepub fn with_max_reconnect_attempts(self, attempts: u32) -> Self
pub fn with_max_reconnect_attempts(self, attempts: u32) -> Self
Set the maximum reconnection attempts.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WsConfig
impl RefUnwindSafe for WsConfig
impl Send for WsConfig
impl Sync for WsConfig
impl Unpin for WsConfig
impl UnsafeUnpin for WsConfig
impl UnwindSafe for WsConfig
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