pub struct WsConfigBuilder { /* private fields */ }Expand description
Builder for WsConfig.
Implementations§
Source§impl WsConfigBuilder
impl WsConfigBuilder
Sourcepub fn heartbeat_interval(self, v: Duration) -> Self
pub fn heartbeat_interval(self, v: Duration) -> Self
Set heartbeat interval.
Sourcepub fn broadcast_capacity(self, v: usize) -> Self
pub fn broadcast_capacity(self, v: usize) -> Self
Set broadcast channel capacity.
Sourcepub fn max_connections(self, v: usize) -> Self
pub fn max_connections(self, v: usize) -> Self
Set maximum connection limit.
Sourcepub fn allowed_origins(self, origins: Vec<String>) -> Self
pub fn allowed_origins(self, origins: Vec<String>) -> Self
Replace the Origin allow-list (REQ-WSKIT-200). Empty (default) =
allow ALL origins — see WsConfig::allowed_origins for why you
almost certainly want to set this.
Sourcepub fn allow_origin(self, origin: impl Into<String>) -> Self
pub fn allow_origin(self, origin: impl Into<String>) -> Self
Add one origin to the allow-list (REQ-WSKIT-200), e.g.
.allow_origin("https://app.example.com"). Exact match after
normalization; no wildcards in v1.
Trait Implementations§
Source§impl Clone for WsConfigBuilder
impl Clone for WsConfigBuilder
Source§impl Debug for WsConfigBuilder
impl Debug for WsConfigBuilder
Auto Trait Implementations§
impl Freeze for WsConfigBuilder
impl RefUnwindSafe for WsConfigBuilder
impl Send for WsConfigBuilder
impl Sync for WsConfigBuilder
impl Unpin for WsConfigBuilder
impl UnsafeUnpin for WsConfigBuilder
impl UnwindSafe for WsConfigBuilder
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