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>;
}
Expand description
A trait for WebSocket messages
Required Methods
Writes this message to the writer
fn message_size(&self, masked: bool) -> usize
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>
fn from_dataframes<D: DataFrameable>(frames: Vec<D>) -> WebSocketResult<Self>
Attempt to form a message from a series of data frames