pub struct WebSocketServerBuilder { /* private fields */ }Expand description
Builder for WebSocket server configuration.
Implementations§
Source§impl WebSocketServerBuilder
impl WebSocketServerBuilder
Sourcepub fn bind_addr(self, addr: SocketAddr) -> Self
pub fn bind_addr(self, addr: SocketAddr) -> Self
Set the bind address.
Sourcepub fn bind(self, addr: &str) -> WebSocketResult<Self>
pub fn bind(self, addr: &str) -> WebSocketResult<Self>
Set the bind address from a string.
Sourcepub fn max_message_size(self, size: usize) -> Self
pub fn max_message_size(self, size: usize) -> Self
Set the maximum message size.
Sourcepub fn heartbeat_interval(self, interval: Duration) -> Self
pub fn heartbeat_interval(self, interval: Duration) -> Self
Set the heartbeat interval.
Sourcepub fn connection_timeout(self, timeout: Duration) -> Self
pub fn connection_timeout(self, timeout: Duration) -> Self
Set the connection timeout.
Sourcepub fn build<H: WebSocketHandler>(self, handler: H) -> WebSocketServer<H>
pub fn build<H: WebSocketHandler>(self, handler: H) -> WebSocketServer<H>
Build the server with the given handler.
Trait Implementations§
Source§impl Debug for WebSocketServerBuilder
impl Debug for WebSocketServerBuilder
Source§impl Default for WebSocketServerBuilder
impl Default for WebSocketServerBuilder
Source§fn default() -> WebSocketServerBuilder
fn default() -> WebSocketServerBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WebSocketServerBuilder
impl RefUnwindSafe for WebSocketServerBuilder
impl Send for WebSocketServerBuilder
impl Sync for WebSocketServerBuilder
impl Unpin for WebSocketServerBuilder
impl UnwindSafe for WebSocketServerBuilder
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