[][src]Enum ws_stream_wasm::WsMessage

pub enum WsMessage {
    Text(String),
    Binary(Vec<u8>),
}

Represents a WebSocket Message, after converting from JavaScript type.

Variants

Text(String)

The data of the message is a string.

Binary(Vec<u8>)

The message contains binary data.

Trait Implementations

impl AsRef<[u8]> for WsMessage[src]

impl Clone for WsMessage[src]

impl Debug for WsMessage[src]

impl Eq for WsMessage[src]

impl From<String> for WsMessage[src]

impl From<Vec<u8>> for WsMessage[src]

impl From<WsMessage> for Vec<u8>[src]

impl Hash for WsMessage[src]

impl PartialEq<WsMessage> for WsMessage[src]

impl Sink<WsMessage> for WsStream[src]

type Error = WsErr

The type of value produced by the sink when an error occurs.

impl StructuralEq for WsMessage[src]

impl StructuralPartialEq for WsMessage[src]

impl TryFrom<MessageEvent> for WsMessage[src]

This will convert the JavaScript event into a WsMessage. Note that this will only work if the connection is set to use the binary type ArrayBuffer. On binary type Blob, this will panic.

type Error = WsErr

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.