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