Struct WebSocket

struct WebSocket { ... }

A stream of WebSocket messages.

See the module level documentation for more details.

Implementations

impl WebSocket

async fn recv(self: &mut Self) -> Option<Result<Message, Error>>

Receive another message.

Returns None if the stream has closed.

async fn send(self: &mut Self, msg: Message) -> Result<(), Error>

Send a message.

fn protocol(self: &Self) -> Option<&HeaderValue>

Return the selected WebSocket subprotocol, if one has been chosen.

impl Debug for WebSocket

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl Freeze for WebSocket

impl RefUnwindSafe for WebSocket

impl Send for WebSocket

impl Sink for WebSocket

fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), <Self as >::Error>>
fn start_send(self: Pin<&mut Self>, item: Message) -> Result<(), <Self as >::Error>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), <Self as >::Error>>
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), <Self as >::Error>>

impl Stream for WebSocket

fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<<Self as >::Item>>

impl Sync for WebSocket

impl Unpin for WebSocket

impl UnwindSafe for WebSocket

impl<S> TryStreamExt for WebSocket

impl<S, T, E> TryStream for WebSocket

fn try_poll_next(self: Pin<&mut S>, cx: &mut Context<'_>) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>

impl<T> Any for WebSocket

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for WebSocket

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for WebSocket

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for WebSocket

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for WebSocket

impl<T> Same for WebSocket

impl<T> StreamExt for WebSocket

impl<T> WithSubscriber for WebSocket

impl<T, Item> SinkExt for WebSocket

impl<T, U> Into for WebSocket

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for WebSocket

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for WebSocket

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>

impl<V, T> VZip for WebSocket

fn vzip(self: Self) -> V