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§
Required Methods§
sourcefn poll_recv_msg(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut MsgBuf<'_>,
abuf: Option<&mut Self::AddrBuf>
) -> Poll<Result<RecvResult, Self::Error>>
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.