[][src]Trait websocket_base::ws::message::Message

pub trait Message: Sized {
    fn serialize(&self, _: &mut dyn Write, masked: bool) -> WebSocketResult<()>;
fn message_size(&self, masked: bool) -> usize;
fn from_dataframes<D: DataFrameable>(
        frames: Vec<D>
    ) -> WebSocketResult<Self>; }

A trait for WebSocket messages

Required methods

fn serialize(&self, _: &mut dyn Write, masked: bool) -> WebSocketResult<()>

Writes this message to the writer

fn message_size(&self, masked: bool) -> usize

Returns how many bytes this message will take up

fn from_dataframes<D: DataFrameable>(frames: Vec<D>) -> WebSocketResult<Self>

Attempt to form a message from a series of data frames

Loading content...

Implementors

impl Message for OwnedMessage[src]

fn serialize(&self, writer: &mut dyn Write, masked: bool) -> WebSocketResult<()>[src]

Attempt to form a message from a series of data frames

fn message_size(&self, masked: bool) -> usize[src]

Returns how many bytes this message will take up

fn from_dataframes<D>(frames: Vec<D>) -> WebSocketResult<Self> where
    D: DataFrameTrait
[src]

Attempt to form a message from a series of data frames

impl<'a> Message for Message<'a>[src]

fn serialize(&self, writer: &mut dyn Write, masked: bool) -> WebSocketResult<()>[src]

Attempt to form a message from a series of data frames

fn message_size(&self, masked: bool) -> usize[src]

Returns how many bytes this message will take up

fn from_dataframes<D>(frames: Vec<D>) -> WebSocketResult<Self> where
    D: DataFrameTrait
[src]

Attempt to form a message from a series of data frames

Loading content...