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(String)
Text message
Blob(Blob)
Binary message received as a blob
ArrayBuffer(ArrayBuffer)
Binary message received as an array buffer
Methods
impl SocketMessageData
[src]
pub fn into_text(self) -> Option<String>
[src]
Try to receive the message as text
pub fn into_blob(self) -> Option<Blob>
[src]
Try to receive the message as a binary blob
pub fn into_array_buffer(self) -> Option<ArrayBuffer>
[src]
Try to receive the message as an array buffer
Trait Implementations
impl Debug for SocketMessageData
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for SocketMessageData
[src]
fn clone(&self) -> SocketMessageData
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more