pub trait RecvMsg {
type Error;
type AddrBuf;
// Required method
fn recv_msg(
&mut self,
buf: &mut MsgBuf<'_>,
abuf: Option<&mut Self::AddrBuf>
) -> Result<RecvResult, Self::Error>;
}
Expand description
Receiving from socket-like connections with message boundaries without truncation.
Required Associated Types§
Required Methods§
sourcefn recv_msg(
&mut self,
buf: &mut MsgBuf<'_>,
abuf: Option<&mut Self::AddrBuf>
) -> Result<RecvResult, Self::Error>
fn recv_msg( &mut self, buf: &mut MsgBuf<'_>, abuf: Option<&mut Self::AddrBuf> ) -> Result<RecvResult, Self::Error>
Receives one message using the given buffer, (re)allocating the buffer if necessary.
In the Ok(..)
case, 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.