Struct websocket::receiver::Reader

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

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

Implementations

Reads a single data frame from the remote endpoint.

Returns an iterator over incoming data frames.

Reads a single message from this receiver.

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

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

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Get the TypeId of this object.