[−][src]Enum stdweb::web::event::SocketMessageData
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 TryFrom<Value> for SocketMessageData
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(v: Value) -> Result<SocketMessageData, ConversionError>
[src]
impl Clone for SocketMessageData
[src]
fn clone(&self) -> SocketMessageData
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SocketMessageData
[src]
Auto Trait Implementations
impl Send for SocketMessageData
impl Sync for SocketMessageData
impl Unpin for SocketMessageData
impl UnwindSafe for SocketMessageData
impl RefUnwindSafe for SocketMessageData
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,