Struct websocket::receiver::Reader [−][src]
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
impl<R> Reader<R> where
R: Read,
[src]
R: Read,
pub fn recv_dataframe(&mut self) -> WebSocketResult<DataFrame>
[src]
Reads a single data frame from the remote endpoint.
pub fn incoming_dataframes(
&mut self
) -> DataFrameIterator<'_, Receiver, BufReader<R>>ⓘNotable traits for DataFrameIterator<'a, Recv, R>
impl<'a, Recv, R> Iterator for DataFrameIterator<'a, Recv, R> where
R: Read,
Recv: 'a + Receiver, type Item = Result<<Recv as Receiver>::F, WebSocketError>;
[src]
&mut self
) -> DataFrameIterator<'_, Receiver, BufReader<R>>ⓘ
Notable traits for DataFrameIterator<'a, Recv, R>
impl<'a, Recv, R> Iterator for DataFrameIterator<'a, Recv, R> where
R: Read,
Recv: 'a + Receiver, type Item = Result<<Recv as Receiver>::F, WebSocketError>;
Returns an iterator over incoming data frames.
pub fn recv_message(&mut self) -> WebSocketResult<OwnedMessage>
[src]
Reads a single message from this receiver.
pub fn incoming_messages<'a>(
&'a mut self
) -> MessageIterator<'a, Receiver, BufReader<R>>ⓘNotable traits for MessageIterator<'a, Recv, R>
impl<'a, Recv, R> Iterator for MessageIterator<'a, Recv, R> where
R: Read,
Recv: 'a + Receiver, type Item = Result<<Recv as Receiver>::M, WebSocketError>;
[src]
&'a mut self
) -> MessageIterator<'a, Receiver, BufReader<R>>ⓘ
Notable traits for MessageIterator<'a, Recv, R>
impl<'a, Recv, R> Iterator for MessageIterator<'a, Recv, R> where
R: Read,
Recv: 'a + Receiver, type Item = Result<<Recv as Receiver>::M, WebSocketError>;
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]
S: AsTcpStream + Stream + Read,
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> RefUnwindSafe for Reader<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for Reader<R> where
R: Send,
R: Send,
impl<R> Sync for Reader<R> where
R: Sync,
R: Sync,
impl<R> Unpin for Reader<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for Reader<R> where
R: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,