Trait recvmsg::sync::RecvMsg

source ·
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§

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 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.

Implementations on Foreign Types§

source§

impl RecvMsg for &UdpSocket

§

type Error = Error

§

type AddrBuf = SocketAddr

source§

fn recv_msg( &mut self, buf: &mut MsgBuf<'_>, abuf: Option<&mut InetAddr> ) -> Result<RecvResult>

source§

impl RecvMsg for &UnixDatagram

§

type Error = Error

§

type AddrBuf = SocketAddr

source§

fn recv_msg( &mut self, buf: &mut MsgBuf<'_>, abuf: Option<&mut UnixAddr> ) -> Result<RecvResult>

source§

impl RecvMsg for UdpSocket

§

type Error = Error

§

type AddrBuf = SocketAddr

source§

fn recv_msg( &mut self, buf: &mut MsgBuf<'_>, abuf: Option<&mut InetAddr> ) -> Result<RecvResult>

source§

impl RecvMsg for UnixDatagram

§

type Error = Error

§

type AddrBuf = SocketAddr

source§

fn recv_msg( &mut self, buf: &mut MsgBuf<'_>, abuf: Option<&mut UnixAddr> ) -> Result<RecvResult>

source§

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

§

type Error = <T as RecvMsg>::Error

§

type AddrBuf = <T as RecvMsg>::AddrBuf

source§

fn recv_msg( &mut self, buf: &mut MsgBuf<'_>, abuf: Option<&mut Self::AddrBuf> ) -> Result<RecvResult, Self::Error>

source§

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

§

type Error = <T as RecvMsg>::Error

§

type AddrBuf = <T as RecvMsg>::AddrBuf

source§

fn recv_msg( &mut self, buf: &mut MsgBuf<'_>, abuf: Option<&mut Self::AddrBuf> ) -> Result<RecvResult, Self::Error>

Implementors§

source§

impl<AddrBuf> RecvMsg for Empty<AddrBuf>

§

type Error = Infallible

§

type AddrBuf = AddrBuf