Trait EnqueueFd

Source
pub trait EnqueueFd {
    // Required method
    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§

Source

fn enqueue(&mut self, fd: &impl AsRawFd) -> Result<(), QueueFullError>

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl EnqueueFd for fd_queue::mio::UnixStream

Source§

impl EnqueueFd for fd_queue::UnixStream

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.

Source§

impl EnqueueFd for fd_queue::tokio::UnixStream