Trait websocket::ws::Receiver[][src]

pub trait Receiver {
    type F: DataFrame;
    type M: Message;
    pub fn recv_dataframe<R>(
        &mut self,
        reader: &mut R
    ) -> Result<Self::F, WebSocketError>
    where
        R: Read
;
pub fn recv_message_dataframes<R>(
        &mut self,
        reader: &mut R
    ) -> Result<Vec<Self::F, Global>, WebSocketError>
    where
        R: Read
; pub fn incoming_dataframes<R>(
        &'a mut self,
        reader: &'a mut R
    ) -> DataFrameIterator<'a, Self, 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>;

    where
        R: Read
, { ... }
pub fn recv_message<R>(
        &mut self,
        reader: &mut R
    ) -> Result<Self::M, WebSocketError>
    where
        R: Read
, { ... }
pub fn incoming_messages<R>(
        &'a mut self,
        reader: &'a mut R
    ) -> MessageIterator<'a, Self, 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>;

    where
        R: Read
, { ... } }

A trait for receiving data frames and messages.

Associated Types

type F: DataFrame[src]

The type of dataframe that incoming messages will be serialized to.

type M: Message[src]

The type of message that incoming messages will be serialized to.

Loading content...

Required methods

pub fn recv_dataframe<R>(
    &mut self,
    reader: &mut R
) -> Result<Self::F, WebSocketError> where
    R: Read
[src]

Reads a single data frame from this receiver.

pub fn recv_message_dataframes<R>(
    &mut self,
    reader: &mut R
) -> Result<Vec<Self::F, Global>, WebSocketError> where
    R: Read
[src]

Returns the data frames that constitute one message.

Loading content...

Provided methods

pub fn incoming_dataframes<R>(
    &'a mut self,
    reader: &'a mut R
) -> DataFrameIterator<'a, Self, 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>;
where
    R: Read
[src]

Returns an iterator over incoming data frames.

pub fn recv_message<R>(
    &mut self,
    reader: &mut R
) -> Result<Self::M, WebSocketError> where
    R: Read
[src]

Reads a single message from this receiver.

pub fn incoming_messages<R>(
    &'a mut self,
    reader: &'a mut R
) -> MessageIterator<'a, Self, 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>;
where
    R: Read
[src]

Returns an iterator over incoming messages.

Loading content...

Implementors

impl Receiver for Receiver[src]

type F = DataFrame

type M = OwnedMessage

fn recv_dataframe<R>(&mut self, reader: &mut R) -> WebSocketResult<DataFrame> where
    R: Read
[src]

Reads a single data frame from the remote endpoint.

fn recv_message_dataframes<R>(
    &mut self,
    reader: &mut R
) -> WebSocketResult<Vec<DataFrame>> where
    R: Read
[src]

Returns the data frames that constitute one message.

Loading content...