Struct soketto::connection::Receiver
source · pub struct Receiver<T> { /* private fields */ }
Expand description
The receiving half of a connection.
Implementations§
source§impl<T: AsyncRead + AsyncWrite + Unpin> Receiver<T>
impl<T: AsyncRead + AsyncWrite + Unpin> Receiver<T>
sourcepub async fn receive(
&mut self,
message: &mut Vec<u8>
) -> Result<Incoming<'_>, Error>
pub async fn receive( &mut self, message: &mut Vec<u8> ) -> Result<Incoming<'_>, Error>
Receive the next websocket message.
The received frames forming the complete message will be appended to
the given message
argument. The returned Incoming
value describes
the type of data that was received, e.g. binary or textual data.
Interleaved PONG frames are returned immediately as Data::Pong
values. If PONGs are not expected or uninteresting,
Receiver::receive_data
may be used instead which skips over PONGs
and considers only application payload data.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Receiver<T>
impl<T> Send for Receiver<T>where T: Send,
impl<T> Sync for Receiver<T>where T: Send,
impl<T> Unpin for Receiver<T>
impl<T> !UnwindSafe for Receiver<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more