Struct websocket::receiver::Receiver [] [src]

pub struct Receiver<R> {
    // some fields omitted
}

A Receiver that wraps a Reader and provides a default implementation using DataFrames and Messages.

Methods

impl<R> Receiver<R> where R: Read

fn new(reader: R, mask: bool) -> Receiver<R>

Create a new Receiver using the specified Reader.

fn get_ref(&self) -> &BufReader<R>

Returns a reference to the underlying Reader.

fn get_mut(&mut self) -> &mut BufReader<R>

Returns a mutable reference to the underlying Reader.

impl Receiver<WebSocketStream>

fn shutdown(&mut self) -> IoResult<()>

Closes the receiver side of the connection, will cause all pending and future IO to return immediately with an appropriate value.

fn shutdown_all(&mut self) -> IoResult<()>

Shuts down both Sender and Receiver, will cause all pending and future IO to return immediately with an appropriate value.

Trait Implementations

impl<R: Read> Receiver<DataFrame> for Receiver<R>

fn recv_dataframe(&mut self) -> WebSocketResult<DataFrame>

fn recv_message_dataframes(&mut self) -> WebSocketResult<Vec<DataFrame>>

fn incoming_dataframes<'a>(&'a mut self) -> DataFrameIterator<'a, Self, F>

fn recv_message<'m, D, M, I>(&mut self) -> WebSocketResult<M> where M: Message<'m, D, DataFrameIterator=I>, I: Iterator<Item=D>, D: DataFrame

fn incoming_messages<'a, M, D>(&'a mut self) -> MessageIterator<'a, Self, D, F, M> where M: Message<'a, D>, D: DataFrame