Struct tokio_websockets::proto::WebSocketStream
source · pub struct WebSocketStream<T> { /* private fields */ }
Expand description
A WebSocket stream that full messages can be read from and written to.
The stream implements futures_sink::Sink
and futures_core::Stream
.
You must use a ClientBuilder
or ServerBuilder
to
obtain a WebSocket stream.
For usage examples, see the top level crate documentation, which showcases a simple echo server and client.
Trait Implementations§
source§impl<T: Debug> Debug for WebSocketStream<T>
impl<T: Debug> Debug for WebSocketStream<T>
source§impl<T> Sink<Message> for WebSocketStream<T>
impl<T> Sink<Message> for WebSocketStream<T>
source§fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Attempts to prepare the
Sink
to receive a value. Read moresource§fn start_send(self: Pin<&mut Self>, item: Message) -> Result<(), Self::Error>
fn start_send(self: Pin<&mut Self>, item: Message) -> Result<(), Self::Error>
Begin the process of sending a value to the sink.
Each call to this function must be preceded by a successful call to
poll_ready
which returned Poll::Ready(Ok(()))
. Read moresource§impl<T> Stream for WebSocketStream<T>
impl<T> Stream for WebSocketStream<T>
impl<T> Sync for WebSocketStream<T>
Auto Trait Implementations§
impl<T> Freeze for WebSocketStream<T>where
T: Freeze,
impl<T> !RefUnwindSafe for WebSocketStream<T>
impl<T> Send for WebSocketStream<T>where
T: Send,
impl<T> Unpin for WebSocketStream<T>where
T: Unpin,
impl<T> UnwindSafe for WebSocketStream<T>where
T: UnwindSafe,
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