Trait AsyncRecv

Source
pub trait AsyncRecv {
    // Required method
    fn poll_recv(
        &mut self,
        cx: &mut Context<'_>,
        bufs: &mut [IoSliceMut<'_>],
    ) -> Poll<Result<usize>>;
}
Expand description

Trait implemented by types that can receive datagrams.

This is different from [futures::AsyncRead], which is used for byte streams.

Required Methods§

Source

fn poll_recv( &mut self, cx: &mut Context<'_>, bufs: &mut [IoSliceMut<'_>], ) -> Poll<Result<usize>>

Polls for an incoming datagram, which will be gathered into bufs.

At most one datagram will be received per call.

Implementations on Foreign Types§

Source§

impl<T: AsyncRecv + ?Sized> AsyncRecv for &mut T

Source§

fn poll_recv( &mut self, cx: &mut Context<'_>, bufs: &mut [IoSliceMut<'_>], ) -> Poll<Result<usize>>

Implementors§

Source§

impl<M: RingMem> AsyncRecv for MessagePipe<M>

Source§

impl<M: RingMem> AsyncRecv for MessageReadHalf<'_, M>