[][src]Struct websocket::receiver::Reader

pub struct Reader<R> where
    R: Read
{ pub stream: BufReader<R>, pub receiver: Receiver, }

This reader bundles an existing stream with a parsing algorithm. It is used by the client in its .split() function as the reading component.

Fields

stream: BufReader<R>

the stream to be read from

receiver: Receiver

the parser to parse bytes into messages

Methods

impl<R> Reader<R> where
    R: Read
[src]

pub fn recv_dataframe(&mut self) -> WebSocketResult<DataFrame>[src]

Reads a single data frame from the remote endpoint.

Important traits for DataFrameIterator<'a, Recv, R>
pub fn incoming_dataframes(
    &mut self
) -> DataFrameIterator<Receiver, BufReader<R>>
[src]

Returns an iterator over incoming data frames.

pub fn recv_message(&mut self) -> WebSocketResult<OwnedMessage>[src]

Reads a single message from this receiver.

Important traits for MessageIterator<'a, Recv, R>
pub fn incoming_messages<'a>(
    &'a mut self
) -> MessageIterator<'a, Receiver, BufReader<R>>
[src]

An iterator over incoming messsages. This iterator will block until new messages arrive and will never halt.

impl<S> Reader<S> where
    S: AsTcpStream + Stream + Read
[src]

pub fn shutdown(&self) -> IoResult<()>[src]

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

pub fn shutdown_all(&self) -> IoResult<()>[src]

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

Auto Trait Implementations

impl<R> Send for Reader<R> where
    R: Send

impl<R> Sync for Reader<R> where
    R: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> Erased for T