pub struct WebSocketConfig {
pub base: DeribitConfig,
pub ping_interval: u64,
pub pong_timeout: u64,
pub reconnect_attempts: u32,
pub reconnect_delay: u64,
pub max_message_size: usize,
pub compression: bool,
}Expand description
Connection configuration for WebSocket
Fields§
§base: DeribitConfigBase configuration
ping_interval: u64Ping interval in seconds
pong_timeout: u64Pong timeout in seconds
reconnect_attempts: u32Reconnect attempts
reconnect_delay: u64Reconnect delay in seconds
max_message_size: usizeMaximum message size
compression: boolEnable compression
Implementations§
Source§impl WebSocketConfig
impl WebSocketConfig
Sourcepub fn new(base: DeribitConfig) -> Self
pub fn new(base: DeribitConfig) -> Self
Create new WebSocket configuration
Sourcepub fn with_ping_interval(self, ping_interval: u64) -> Self
pub fn with_ping_interval(self, ping_interval: u64) -> Self
Set ping interval
Sourcepub fn with_pong_timeout(self, pong_timeout: u64) -> Self
pub fn with_pong_timeout(self, pong_timeout: u64) -> Self
Set pong timeout
Sourcepub fn with_reconnect_attempts(self, reconnect_attempts: u32) -> Self
pub fn with_reconnect_attempts(self, reconnect_attempts: u32) -> Self
Set reconnect attempts
Sourcepub fn with_reconnect_delay(self, reconnect_delay: u64) -> Self
pub fn with_reconnect_delay(self, reconnect_delay: u64) -> Self
Set reconnect delay
Sourcepub fn with_compression(self, compression: bool) -> Self
pub fn with_compression(self, compression: bool) -> Self
Enable/disable compression
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
Source§impl<'de> Deserialize<'de> for WebSocketConfig
impl<'de> Deserialize<'de> for WebSocketConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for WebSocketConfig
impl Display 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