pub struct WsOptions {
pub max_message_size: usize,
pub allowed_origins: Vec<String>,
pub ping_interval: Option<Duration>,
pub idle_timeout: Option<Duration>,
}Expand description
Per-endpoint settings
Fields§
§max_message_size: usizeLargest accepted message and frame in bytes (default 1 MiB)
allowed_origins: Vec<String>Extra Origin values (e.g. https://app.example.com) that may connect
besides the host serving the endpoint
ping_interval: Option<Duration>Send a ping this often while WebSocket::recv is waiting (default
30 s, None = never). Browsers answer automatically, which keeps
proxies from dropping idle connections.
idle_timeout: Option<Duration>Close the connection when nothing at all (message, pong) arrived for this
long (default 90 s, None = never), so dead peers do not pile up
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WsOptions
impl RefUnwindSafe for WsOptions
impl Send for WsOptions
impl Sync for WsOptions
impl Unpin for WsOptions
impl UnsafeUnpin for WsOptions
impl UnwindSafe for WsOptions
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