pub struct WsConfig {
pub heartbeat_interval: Duration,
pub broadcast_capacity: usize,
pub max_connections: usize,
}Expand description
Configuration for WebSocket connections and broadcast channels.
§Example
use ws_kit::config::WsConfig;
use std::time::Duration;
let cfg = WsConfig::builder()
.heartbeat_interval(Duration::from_secs(15))
.broadcast_capacity(2048)
.max_connections(5000)
.build();
assert_eq!(cfg.heartbeat_interval, Duration::from_secs(15));Fields§
§heartbeat_interval: DurationInterval between heartbeat pings.
broadcast_capacity: usizeCapacity of each broadcast channel.
max_connections: usizeMaximum concurrent connections allowed (0 = unlimited).
Implementations§
Trait Implementations§
impl Eq for WsConfig
impl StructuralPartialEq for WsConfig
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