Enum stdweb::web::event::SocketMessageData [] [src]

pub enum SocketMessageData {
    Text(String),
    Blob(Blob),
    ArrayBuffer(ArrayBuffer),
}

Represents the types of data which can be received on a web socket. Messages are transmitted tagged as either binary or text: text messages are always received as strings. Binary messages may be received as either blobs or array buffers as preferred by the receiver. This choice is indicated via the binary_type field on the web socket.

Variants

Text message

Binary message received as a blob

Binary message received as an array buffer

Methods

impl SocketMessageData
[src]

[src]

Try to receive the message as text

[src]

Try to receive the message as a binary blob

[src]

Try to receive the message as an array buffer

Trait Implementations

impl Debug for SocketMessageData
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for SocketMessageData
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl TryFrom<Value> for SocketMessageData
[src]

The type returned in the event of a conversion error.

[src]

Performs the conversion.

Auto Trait Implementations