pub trait Receiver: Sized {
type F: DataFrame;
type M: Message;
fn recv_dataframe<R>(&mut self, reader: &mut R) -> WebSocketResult<Self::F>
where
R: Read;
fn recv_message_dataframes<R>(
&mut self,
reader: &mut R
) -> WebSocketResult<Vec<Self::F>>
where
R: Read;
fn incoming_dataframes<'a, 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
Recv: 'a + Receiver,
R: Read, type Item = WebSocketResult<Recv::F>;
where
R: Read,
{ ... }
fn recv_message<R>(&mut self, reader: &mut R) -> WebSocketResult<Self::M>
where
R: Read,
{ ... }
fn incoming_messages<'a, 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
Recv: 'a + Receiver,
R: Read, type Item = WebSocketResult<Recv::M>;
where
R: Read,
{ ... }
}
Expand description
A trait for receiving data frames and messages.
Required Associated Types
Required Methods
fn recv_dataframe<R>(&mut self, reader: &mut R) -> WebSocketResult<Self::F> where
R: Read,
fn recv_dataframe<R>(&mut self, reader: &mut R) -> WebSocketResult<Self::F> where
R: Read,
Reads a single data frame from this receiver.
fn recv_message_dataframes<R>(
&mut self,
reader: &mut R
) -> WebSocketResult<Vec<Self::F>> where
R: Read,
fn recv_message_dataframes<R>(
&mut self,
reader: &mut R
) -> WebSocketResult<Vec<Self::F>> where
R: Read,
Returns the data frames that constitute one message.
Provided Methods
fn incoming_dataframes<'a, 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
Recv: 'a + Receiver,
R: Read, type Item = WebSocketResult<Recv::F>;
where
R: Read,
fn incoming_dataframes<'a, 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
Recv: 'a + Receiver,
R: Read, type Item = WebSocketResult<Recv::F>;
where
R: Read,
Recv: 'a + Receiver,
R: Read, type Item = WebSocketResult<Recv::F>;
Returns an iterator over incoming data frames.
fn recv_message<R>(&mut self, reader: &mut R) -> WebSocketResult<Self::M> where
R: Read,
fn recv_message<R>(&mut self, reader: &mut R) -> WebSocketResult<Self::M> where
R: Read,
Reads a single message from this receiver.
fn incoming_messages<'a, 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
Recv: 'a + Receiver,
R: Read, type Item = WebSocketResult<Recv::M>;
where
R: Read,
fn incoming_messages<'a, 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
Recv: 'a + Receiver,
R: Read, type Item = WebSocketResult<Recv::M>;
where
R: Read,
Recv: 'a + Receiver,
R: Read, type Item = WebSocketResult<Recv::M>;
Returns an iterator over incoming messages.