[][src]Struct vujio_server::WebSocketConnection

pub struct WebSocketConnection(_, _);

WebSocket connection

This is the type that the handler passed to [WebSocket::new] receives. It represents a bidirectional stream of websocket data.


impl WebSocketConnection[src]

pub async fn send_string(&'_ self, s: String) -> Result<(), Error>[src]

Sends a string message to the connected websocket client

pub async fn send_bytes(&'_ self, bytes: Vec<u8, Global>) -> Result<(), Error>[src]

Sends a binary message to the connected websocket client

pub async fn send_json(&'_ self, json: &'_ impl Serialize) -> Result<(), Error>[src]

Sends the serde_json serialization of the provided type as a string to the connected websocket client

Trait Implementations

impl Clone for WebSocketConnection[src]

impl Debug for WebSocketConnection[src]

impl From<WebSocketStream<Connection>> for WebSocketConnection[src]

impl Stream for WebSocketConnection[src]

type Item = Result<Message, Error>

Values yielded by the stream.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<I> IntoStream for I where
    I: Stream

type Item = <I as Stream>::Item

The type of the elements being iterated over.

type IntoStream = I

Which kind of stream are we turning this into?

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> StreamExt for T where
    T: Stream + ?Sized

impl<S> StreamExt for S where
    S: Stream + ?Sized

impl<T> StreamExt for T where
    T: Stream + ?Sized

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,