Struct websocket_stream::WebsocketStream
[−]
[src]
pub struct WebsocketStream { /* fields omitted */ }
RFC-6455 Protocol stream
Methods
impl WebsocketStream
[src]
fn new(stream: TcpStream, mode: Mode) -> NewResult
Attempts to create a new stream in specified mode
fn set_mode(&mut self, mode: Mode) -> SetFdResult
Sets the socket to the specified mode
fn read(&mut self) -> ReadResult
Attempts to read data from the socket.
If stream is in Mode::Block, this will block forever until data is received
If socket is in Mode::NonBlock and data is available, it will read until a complete message is received. If the buffer has run out, and it is still waiting on the remaining payload, it will adjust the remaining needed in it's buffer and will adjust on the next call to this function.
fn write(&mut self, op: OpCode, payload: &mut Vec<u8>) -> WriteResult
Attempts to write data to the socket
Trait Implementations
impl Clone for WebsocketStream
[src]
fn clone(&self) -> WebsocketStream
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more