[−][src]Trait websocket::ws::dataframe::DataFrame
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
fn is_last(&self) -> bool
Is this dataframe the final dataframe of the message?
fn opcode(&self) -> u8
What type of data does this dataframe contain?
fn reserved(&self) -> &[bool; 3]
Reserved bits of this dataframe
fn size(&self) -> usize
How long (in bytes) is this dataframe's payload
fn write_payload(&self, socket: &mut dyn Write) -> WebSocketResult<()>
Write the payload to a writer
fn take_payload(self) -> Vec<u8>
Takes the payload out into a vec
Provided Methods
fn frame_size(&self, masked: bool) -> usize
Get's the size of the entire dataframe in bytes, i.e. header and payload.
fn write_to(&self, writer: &mut dyn Write, mask: bool) -> WebSocketResult<()>
Writes a DataFrame to a Writer.
Implementors
impl DataFrame for OwnedMessage
[src]
impl DataFrame for OwnedMessage
fn is_last(&self) -> bool
[src]
fn is_last(&self) -> bool
fn opcode(&self) -> u8
[src]
fn opcode(&self) -> u8
fn reserved(&self) -> &[bool; 3]
[src]
fn reserved(&self) -> &[bool; 3]
fn size(&self) -> usize
[src]
fn size(&self) -> usize
fn write_payload(&self, socket: &mut dyn Write) -> WebSocketResult<()>
[src]
fn write_payload(&self, socket: &mut dyn Write) -> WebSocketResult<()>
fn take_payload(self) -> Vec<u8>
[src]
fn take_payload(self) -> Vec<u8>
fn frame_size(&self, masked: bool) -> usize
[src]
fn frame_size(&self, masked: bool) -> usize
fn write_to(&self, writer: &mut dyn Write, mask: bool) -> WebSocketResult<()>
[src]
fn write_to(&self, writer: &mut dyn Write, mask: bool) -> WebSocketResult<()>
impl DataFrame for DataFrame
[src]
impl DataFrame for DataFrame
fn is_last(&self) -> bool
[src]
fn is_last(&self) -> bool
fn opcode(&self) -> u8
[src]
fn opcode(&self) -> u8
fn reserved(&self) -> &[bool; 3]
[src]
fn reserved(&self) -> &[bool; 3]
fn size(&self) -> usize
[src]
fn size(&self) -> usize
fn write_payload(&self, socket: &mut dyn Write) -> WebSocketResult<()>
[src]
fn write_payload(&self, socket: &mut dyn Write) -> WebSocketResult<()>
fn take_payload(self) -> Vec<u8>
[src]
fn take_payload(self) -> Vec<u8>
fn frame_size(&self, masked: bool) -> usize
[src]
fn frame_size(&self, masked: bool) -> usize
fn write_to(&self, writer: &mut dyn Write, mask: bool) -> WebSocketResult<()>
[src]
fn write_to(&self, writer: &mut dyn Write, mask: bool) -> WebSocketResult<()>
impl<'a> DataFrame for Message<'a>
[src]
impl<'a> DataFrame for Message<'a>
fn is_last(&self) -> bool
[src]
fn is_last(&self) -> bool
fn opcode(&self) -> u8
[src]
fn opcode(&self) -> u8
fn reserved(&self) -> &[bool; 3]
[src]
fn reserved(&self) -> &[bool; 3]
fn size(&self) -> usize
[src]
fn size(&self) -> usize
fn write_payload(&self, socket: &mut dyn Write) -> WebSocketResult<()>
[src]
fn write_payload(&self, socket: &mut dyn Write) -> WebSocketResult<()>
fn take_payload(self) -> Vec<u8>
[src]
fn take_payload(self) -> Vec<u8>
fn frame_size(&self, masked: bool) -> usize
[src]
fn frame_size(&self, masked: bool) -> usize
fn write_to(&self, writer: &mut dyn Write, mask: bool) -> WebSocketResult<()>
[src]
fn write_to(&self, writer: &mut dyn Write, mask: bool) -> WebSocketResult<()>