[][src]Enum in_stream::WsFrame

pub enum WsFrame {
    Text(String),
    Binary(Vec<u8>),
    Ping(Vec<u8>),
    Pong(Vec<u8>),
    Close(CloseData),
}

enumerates the different websocket message types

Variants

Text(String)

utf8 text

Binary(Vec<u8>)

a string of bytes

Ping(Vec<u8>)

a ping message, content must be < 125 bytes

Pong(Vec<u8>)

a pong message, content must be < 125 bytes

Close(CloseData)

a close message, with a websocket close code https://www.iana.org/assignments/websocket/websocket.xml#close-code-number

Methods

impl WsFrame[src]

pub fn assume<O: Into<Self>>(&mut self, oth: O)[src]

consume another frame-type instance

pub fn as_bytes(&self) -> &[u8][src]

get frame data out as byte slice

pub fn as_str(&self) -> Cow<str>[src]

get frame data out as a string slice

pub fn is_text(&self) -> bool[src]

true if frame type is WsFrame::Text

pub fn is_binary(&self) -> bool[src]

true if frame type is WsFrame::Binary

pub fn is_ping(&self) -> bool[src]

true if frame type is WsFrame::Ping

pub fn is_pong(&self) -> bool[src]

true if frame type is WsFrame::Pong

pub fn is_close(&self) -> bool[src]

true if frame type is WsFrame::Close

Trait Implementations

impl Clone for WsFrame[src]

impl Debug for WsFrame[src]

impl Default for WsFrame[src]

impl<'_> From<&'_ [u8]> for WsFrame[src]

impl<'_> From<&'_ str> for WsFrame[src]

impl From<Message> for WsFrame[src]

impl From<String> for WsFrame[src]

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

impl From<WsFrame> for Message[src]

impl<'_, Sub: InStreamStd> InStream<&'_ mut WsFrame, WsFrame> for InStreamWss<Sub>[src]

impl<'_, Sub: InStreamListenerStd> InStreamListener<&'_ mut WsFrame, WsFrame> for InStreamListenerWss<Sub>[src]

type Stream = InStreamWss<Sub::StreamStd>

Auto Trait Implementations

impl RefUnwindSafe for WsFrame

impl Send for WsFrame

impl Sync for WsFrame

impl Unpin for WsFrame

impl UnwindSafe for WsFrame

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> Same<T> for T

type Output = T

Should always be Self

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,