pub trait UnixDatagramExt {
// Required methods
fn send_fds(&self, data: &[u8], fds: &[impl AsFd]) -> Result<usize>;
fn recv_fds<const N: usize>(&self) -> Result<ReceivedFds>;
fn recv_fds_into<const N: usize>(
&self,
data_buf: &mut [u8],
) -> Result<(usize, Vec<OwnedFd>)>;
}Expand description
Extension trait for UnixDatagram adding fd-passing convenience methods.
Required Methods§
Sourcefn send_fds(&self, data: &[u8], fds: &[impl AsFd]) -> Result<usize>
fn send_fds(&self, data: &[u8], fds: &[impl AsFd]) -> Result<usize>
Send data plus borrowed fds. The socket must be connected.
Sourcefn recv_fds<const N: usize>(&self) -> Result<ReceivedFds>
fn recv_fds<const N: usize>(&self) -> Result<ReceivedFds>
Receive data and up to N fds.
Allocates an internal 64 KiB data buffer plus an oversized cmsg
buffer that prevents kernel-level fd leaks. Surplus fds beyond N
are closed automatically.
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.