Trait runa_io_traits::AsyncWriteWithFd
source · pub trait AsyncWriteWithFd {
// Required method
fn poll_write_with_fds<Fds: OwnedFds>(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
fds: &mut Fds
) -> Poll<Result<usize>>;
}
Expand description
A extension trait of AsyncWrite
that supports sending file descriptors
along with data.
Required Methods§
sourcefn poll_write_with_fds<Fds: OwnedFds>(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8],
fds: &mut Fds
) -> Poll<Result<usize>>
fn poll_write_with_fds<Fds: OwnedFds>( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8], fds: &mut Fds ) -> Poll<Result<usize>>
Writes the given buffer and file descriptors to the stream.
Note
To send file descriptors, usually at least one byte of data must be sent. Unless, for example, the implementation choose to buffer the file descriptors until flush is called. Check the documentation of the specific implementation to see if this is the case.
Returns
Returns the number of bytes written on success. The file descriptors will all be sent as long as they don’t exceed the maximum number of file descriptors that can be sent in a message, in which case an error is returned.