pub struct Config {
pub url: String,
pub command_queue_size: usize,
pub event_queue_size: usize,
pub max_reconnect_attempts: u32,
pub reconnect_base_delay: Duration,
pub reconnect_max_delay: Duration,
pub close_timeout: Duration,
pub ping_interval: Option<Duration>,
pub pong_timeout: Duration,
}Fields§
§url: StringWebSocket server URL
command_queue_size: usizeMaximum number of pending commands (backpressure)
event_queue_size: usizeMaximum number of buffered events (backpressure)
max_reconnect_attempts: u32Maximum reconnect attempts (0 = no reconnect)
reconnect_base_delay: DurationBase delay between reconnect attempts
reconnect_max_delay: DurationMaximum delay cap for exponential back-off
close_timeout: DurationHow long to wait for a clean close handshake
ping_interval: Option<Duration>How often to send a Ping frame to the server.
None disables the heartbeat entirely.
pong_timeout: DurationHow long to wait for a Pong after sending a Ping before treating the
connection as dead and triggering a reconnect.
Ignored when ping_interval is None.
Implementations§
Source§impl Config
impl Config
pub fn new(url: impl Into<String>) -> Self
pub fn command_queue_size(self, n: usize) -> Self
pub fn event_queue_size(self, n: usize) -> Self
pub fn max_reconnect_attempts(self, n: u32) -> Self
pub fn reconnect_base_delay(self, d: Duration) -> Self
pub fn reconnect_max_delay(self, d: Duration) -> Self
pub fn close_timeout(self, d: Duration) -> Self
pub fn ping_interval(self, d: Option<Duration>) -> Self
pub fn pong_timeout(self, d: Duration) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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