pub struct WebSocketServer { /* private fields */ }Expand description
A TCP listener that upgrades incoming requests to WebSocket sessions.
Implementations§
Source§impl WebSocketServer
impl WebSocketServer
Sourcepub async fn bind(bind_address: SocketAddr) -> Result<Self, TransportError>
pub async fn bind(bind_address: SocketAddr) -> Result<Self, TransportError>
Bind a WebSocket fallback endpoint on the provided TCP address.
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Returns the local socket address of the bound TCP listener.
Sourcepub async fn accept_session(
&self,
) -> Result<AcceptedWebSocketSession, TransportError>
pub async fn accept_session( &self, ) -> Result<AcceptedWebSocketSession, TransportError>
Accept the next WebSocket session and complete the upgrade handshake.
Auto Trait Implementations§
impl !Freeze for WebSocketServer
impl RefUnwindSafe for WebSocketServer
impl Send for WebSocketServer
impl Sync for WebSocketServer
impl Unpin for WebSocketServer
impl UnsafeUnpin for WebSocketServer
impl UnwindSafe for WebSocketServer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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