pub struct WebSocketConfigBuilder { /* private fields */ }Expand description
Builder for WebSocket configuration
Implementations§
Source§impl WebSocketConfigBuilder
impl WebSocketConfigBuilder
Sourcepub const fn connect_timeout(self, timeout: Duration) -> Self
pub const fn connect_timeout(self, timeout: Duration) -> Self
Set connection timeout
Sourcepub const fn ping_interval(self, interval: Duration) -> Self
pub const fn ping_interval(self, interval: Duration) -> Self
Set ping interval
Sourcepub const fn pong_timeout(self, timeout: Duration) -> Self
pub const fn pong_timeout(self, timeout: Duration) -> Self
Set pong timeout
Sourcepub const fn max_frame_size(self, size: usize) -> Self
pub const fn max_frame_size(self, size: usize) -> Self
Set maximum frame size
Sourcepub const fn max_message_size(self, size: usize) -> Self
pub const fn max_message_size(self, size: usize) -> Self
Set maximum message size
Sourcepub const fn compression(self, compression: CompressionConfig) -> Self
pub const fn compression(self, compression: CompressionConfig) -> Self
Set compression configuration
Sourcepub const fn reconnect(self, reconnect: ReconnectConfig) -> Self
pub const fn reconnect(self, reconnect: ReconnectConfig) -> Self
Set reconnection configuration
Sourcepub fn failover_urls(self, urls: Vec<String>) -> Self
pub fn failover_urls(self, urls: Vec<String>) -> Self
Add failover URLs
Sourcepub const fn heartbeat(
self,
interval_ms: u64,
timeout_ms: u64,
max_missed: u32,
) -> Self
pub const fn heartbeat( self, interval_ms: u64, timeout_ms: u64, max_missed: u32, ) -> Self
Set heartbeat configuration
Sourcepub const fn batch_size(self, size: usize) -> Self
pub const fn batch_size(self, size: usize) -> Self
Set batch size for message processing
Sourcepub fn custom_ping_pong(
self,
ping: Option<String>,
pong: Option<String>,
) -> Self
pub fn custom_ping_pong( self, ping: Option<String>, pong: Option<String>, ) -> Self
Set custom ping/pong messages
Sourcepub fn build(self) -> WebSocketConfig
pub fn build(self) -> WebSocketConfig
Build the configuration
Auto Trait Implementations§
impl Freeze for WebSocketConfigBuilder
impl RefUnwindSafe for WebSocketConfigBuilder
impl Send for WebSocketConfigBuilder
impl Sync for WebSocketConfigBuilder
impl Unpin for WebSocketConfigBuilder
impl UnwindSafe for WebSocketConfigBuilder
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