Enum websocket::message::Message [-] [+] [src]

pub enum Message {
    Text(String),
    Binary(Vec<u8>),
    Close(Option<CloseData>),
    Ping(Vec<u8>),
    Pong(Vec<u8>),
}

Represents a WebSocket message.

Variants

Text

A message containing UTF-8 text data

Binary

A message containing binary data

Close

A message which indicates closure of the WebSocket connection. This message may or may not contain data.

Ping

A ping message - should be responded to with a pong message. Usually the pong message will be sent with the same data as the received ping message.

Pong

A pong message, sent in response to a Ping message, usually containing the same data as the received ping message.

Trait Implementations

impl Message<DataFrame> for Message

type DataFrameIterator = Take<Repeat<DataFrame>>

fn from_dataframes(frames: Vec<DataFrame>) -> WebSocketResult<Message>

Attempt to form a message from a series of data frames

fn into_iter(self) -> Take<Repeat<DataFrame>>

Turns this message into an iterator over data frames

Derived Implementations

impl Debug for Message

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for Message

fn clone(&self) -> Message

fn clone_from(&mut self, source: &Self)

impl PartialEq for Message

fn eq(&self, __arg_0: &Message) -> bool

fn ne(&self, __arg_0: &Message) -> bool