[][src]Trait sendfd_new::RecvWithFd

pub trait RecvWithFd {
    fn recv_with_fd(
        &self,
        bytes: &mut [u8],
        fds: &mut [RawFd]
    ) -> Result<(usize, usize)>; }

An extension trait that enables receiving associated file descriptors along with the data.

Required methods

fn recv_with_fd(
    &self,
    bytes: &mut [u8],
    fds: &mut [RawFd]
) -> Result<(usize, usize)>

Receive the bytes and the file descriptors.

The bytes and the file descriptors are received into the corresponding buffers.

Loading content...

Implementations on Foreign Types

impl RecvWithFd for UnixStream[src]

fn recv_with_fd(
    &self,
    bytes: &mut [u8],
    fds: &mut [RawFd]
) -> Result<(usize, usize)>
[src]

Receive the bytes and the file descriptors from the stream.

It is not guaranteed that the received information will form a single coherent packet of data. In other words, it is not required that this receives the bytes and file descriptors that were sent with a single send_with_fd call by somebody else.

impl RecvWithFd for UnixDatagram[src]

fn recv_with_fd(
    &self,
    bytes: &mut [u8],
    fds: &mut [RawFd]
) -> Result<(usize, usize)>
[src]

Receive the bytes and the file descriptors as a single packet.

It is guaranteed that the received information will form a single coherent packet, and data received will match a corresponding send_with_fd call. Note, however, that in case the receiving buffer(s) are to small, the message may get silently truncated and the undelivered data will be discarded.

For receiving the file descriptors, the internal buffer is sized according to the size of the fds buffer. If the sender sends fds.len() descriptors, but prefaces the descriptors with some other ancilliary data, then some file descriptors may be truncated as well.

Loading content...

Implementors

Loading content...