pub trait EnqueueFd {
    fn enqueue(&mut self, fd: &impl AsRawFd) -> Result<(), QueueFullError>;
}
Expand description

An interface to enqueue a RawFd for later transmission to a different process.

This trait is intended to interact with Write as the mechanism for actually transmitting the enqueued RawFd. Specifically, the RawFd will be transmitted after a write() of at least 1 byte and, possibly, a flush().

Required Methods

Enqueue fd for later transmission to a different process.

The caller is responsible for keeping fd open until after the write() and flush() calls for actually transmitting the fd have been completed.

Implementors

Enqueue a RawFd for later transmission across the UnixStream.

The RawFd will be transmitted on a later call to a method of Write. The number of RawFd that can be enqueued before being transmitted is bounded by FD_QUEUE_SIZE.