[][src]Trait websocket::ws::dataframe::DataFrame

pub trait DataFrame {
    fn is_last(&self) -> bool;
fn opcode(&self) -> u8;
fn reserved(&self) -> &[bool; 3];
fn size(&self) -> usize;
fn write_payload(&self, socket: &mut dyn Write) -> WebSocketResult<()>;
fn take_payload(self) -> Vec<u8>; fn frame_size(&self, masked: bool) -> usize { ... }
fn write_to(
        &self,
        writer: &mut dyn Write,
        mask: bool
    ) -> WebSocketResult<()> { ... } }

A generic DataFrame. Every dataframe should be able to provide these methods. (If the payload is not known in advance then rewrite the write_payload method)

Required Methods

Is this dataframe the final dataframe of the message?

What type of data does this dataframe contain?

Reserved bits of this dataframe

How long (in bytes) is this dataframe's payload

Write the payload to a writer

Important traits for Vec<u8>

Takes the payload out into a vec

Provided Methods

Get's the size of the entire dataframe in bytes, i.e. header and payload.

Writes a DataFrame to a Writer.

Implementors

impl DataFrame for OwnedMessage
[src]

Important traits for Vec<u8>

impl DataFrame for DataFrame
[src]

Important traits for Vec<u8>

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

Important traits for Vec<u8>