Struct rouille::websocket::Websocket[][src]

pub struct Websocket { /* fields omitted */ }

A successful websocket. An open channel of communication. Implements Read and Write.

Implementations

impl Websocket[src]

pub fn send_text(&mut self, data: &str) -> Result<(), SendError>[src]

Sends text data over the websocket.

Returns an error if the message didn’t send correctly or if the connection is closed.

If the client is in javascript, the message will contain a string.

pub fn send_binary(&mut self, data: &[u8]) -> Result<(), SendError>[src]

Sends binary data over the websocket.

Returns an error if the message didn’t send correctly or if the connection is closed.

If the client is in javascript, the message will contain a blob or an arraybuffer.

pub fn is_closed(&self) -> bool[src]

Returns true if the websocket has been closed by either the client (voluntarily or not) or by the server (if the websocket protocol was violated).

Trait Implementations

impl Iterator for Websocket[src]

type Item = Message

The type of the elements being iterated over.

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.