pub struct WebSocketTransport<S> { /* private fields */ }
Expand description
A transport implementation that uses WebSocket protocol for communication.
This transport provides bidirectional communication over WebSocket protocol, supporting both secure (WSS) and standard (WS) connections.
Implementations§
Source§impl<S> WebSocketTransport<S>
impl<S> WebSocketTransport<S>
Sourcepub fn from_stream(stream: WebSocketStream<S>) -> Self
pub fn from_stream(stream: WebSocketStream<S>) -> Self
Creates a new WebSocket transport from an existing WebSocket stream. This is typically used on the server side when accepting a new connection.
§Arguments
stream
- The WebSocket stream from an accepted connection
Source§impl WebSocketTransport<MaybeTlsStream<TcpStream>>
impl WebSocketTransport<MaybeTlsStream<TcpStream>>
Trait Implementations§
Source§impl<S> Transport for WebSocketTransport<S>
impl<S> Transport for WebSocketTransport<S>
Source§fn send<'life0, 'async_trait>(
&'life0 self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a message over the transport
Auto Trait Implementations§
impl<S> Freeze for WebSocketTransport<S>
impl<S> !RefUnwindSafe for WebSocketTransport<S>
impl<S> Send for WebSocketTransport<S>where
S: Send,
impl<S> Sync for WebSocketTransport<S>where
S: Send,
impl<S> Unpin for WebSocketTransport<S>
impl<S> !UnwindSafe for WebSocketTransport<S>
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