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

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

the stream to be read from

the parser to parse bytes into messages

Methods

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

[src]

Reads a single data frame from the remote endpoint.

Important traits for DataFrameIterator<'a, Recv, R>
[src]

Returns an iterator over incoming data frames.

[src]

Reads a single message from this receiver.

Important traits for MessageIterator<'a, Recv, 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]

[src]

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

[src]

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

Trait Implementations

Auto Trait Implementations

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

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