Trait recvmsg::async::RecvMsg

source ·
pub trait RecvMsg {
    type Error;
    type AddrBuf;

    // Required method
    fn poll_recv_msg(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
        buf: &mut MsgBuf<'_>,
        abuf: Option<&mut Self::AddrBuf>
    ) -> Poll<Result<RecvResult, Self::Error>>;
}
Expand description

Implementation of asynchronously receiving from socket-like connections with message boundaries reliably, without truncation.

This is the async version of sync::RecvMsg.

Required Associated Types§

source

type Error

The I/O error type.

This exists not only to make error handling around this trait more flexible, but also to allow the crate to be #![no_std].

source

type AddrBuf

The buffer used for sender address reception.

If sender addresses are not available, this should be NoAddrBuf.

Required Methods§

source

fn poll_recv_msg( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut MsgBuf<'_>, abuf: Option<&mut Self::AddrBuf> ) -> Poll<Result<RecvResult, Self::Error>>

Polls a future that receives one message using the given buffer, (re)allocating the buffer if necessary.

In the Ok(..) cases, if abuf is Some(..), it is filled with the address of the sender.

If the operation could not be completed for external reasons, an error from the outermost Result is returned.

Implementations on Foreign Types§

source§

impl RecvMsg for &UdpSocket

§

type Error = Error

§

type AddrBuf = SocketAddr

source§

fn poll_recv_msg( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut MsgBuf<'_>, abuf: Option<&mut Self::AddrBuf> ) -> Poll<Result<RecvResult>>

source§

impl RecvMsg for &UnixDatagram

§

type Error = Error

§

type AddrBuf = SocketAddr

source§

fn poll_recv_msg( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut MsgBuf<'_>, abuf: Option<&mut Self::AddrBuf> ) -> Poll<Result<RecvResult>>

source§

impl RecvMsg for UdpSocket

§

type Error = Error

§

type AddrBuf = SocketAddr

source§

fn poll_recv_msg( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut MsgBuf<'_>, abuf: Option<&mut Self::AddrBuf> ) -> Poll<Result<RecvResult>>

source§

impl RecvMsg for UnixDatagram

§

type Error = Error

§

type AddrBuf = SocketAddr

source§

fn poll_recv_msg( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut MsgBuf<'_>, abuf: Option<&mut Self::AddrBuf> ) -> Poll<Result<RecvResult>>

source§

impl<T: RecvMsg + Unpin + ?Sized> RecvMsg for &mut T

§

type Error = <T as RecvMsg>::Error

§

type AddrBuf = <T as RecvMsg>::AddrBuf

source§

fn poll_recv_msg( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut MsgBuf<'_>, abuf: Option<&mut Self::AddrBuf> ) -> Poll<Result<RecvResult, Self::Error>>

source§

impl<T: RecvMsg + Unpin + ?Sized> RecvMsg for Box<T>

§

type Error = <T as RecvMsg>::Error

§

type AddrBuf = <T as RecvMsg>::AddrBuf

source§

fn poll_recv_msg( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut MsgBuf<'_>, abuf: Option<&mut Self::AddrBuf> ) -> Poll<Result<RecvResult, Self::Error>>

source§

impl<T: RecvMsg + ?Sized, P: DerefMut<Target = T> + Unpin> RecvMsg for Pin<P>

§

type Error = <T as RecvMsg>::Error

§

type AddrBuf = <T as RecvMsg>::AddrBuf

source§

fn poll_recv_msg( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut MsgBuf<'_>, abuf: Option<&mut Self::AddrBuf> ) -> Poll<Result<RecvResult, Self::Error>>

Implementors§

source§

impl<AddrBuf> RecvMsg for Empty<AddrBuf>

§

type Error = Infallible

§

type AddrBuf = AddrBuf