pub struct WithFd<T> { /* private fields */ }
Expand description
Adapter for sending data with file descriptors.
You can create this by using the WithFdExt
trait and calling the
with_fd
method on supported types.
Implementations§
source§impl WithFd<UnixStream>
impl WithFd<UnixStream>
sourcepub async fn write_with_fd(
&mut self,
buf: &[u8],
fds: &[BorrowedFd<'_>]
) -> Result<usize>
Available on crate feature tokio
only.
pub async fn write_with_fd( &mut self, buf: &[u8], fds: &[BorrowedFd<'_>] ) -> Result<usize>
tokio
only.Write data, with additional pass file descriptors. For most of the
unix systems, file descriptors must be sent along with at
least one byte of data. This is why there is not a
write_fd
method.
source§impl WithFd<Async<UnixStream>>
impl WithFd<Async<UnixStream>>
sourcepub async fn write_with_fd(
&self,
buf: &[u8],
fds: &[BorrowedFd<'_>]
) -> Result<usize>
Available on crate feature async-io
only.
pub async fn write_with_fd( &self, buf: &[u8], fds: &[BorrowedFd<'_>] ) -> Result<usize>
async-io
only.Write data, with additional pass file descriptors. For most of the
unix systems, file descriptors must be sent along with at
least one byte of data. This is why there is not a
write_fd
method.
source§impl<T: AsRawFd> WithFd<T>
impl<T: AsRawFd> WithFd<T>
sourcepub fn take_fds(&mut self) -> impl Iterator<Item = OwnedFd> + '_
pub fn take_fds(&mut self) -> impl Iterator<Item = OwnedFd> + '_
Returns an iterator over the file descriptors received. Every file descriptor this iterator yields will be removed from the internal buffer, and will not be returned again. Dropping the iterator without exhausting it will leave the remaining file descriptors intact.
source§impl WithFd<UnixStream>
impl WithFd<UnixStream>
sourcepub fn write_with_fd(
&mut self,
buf: &[u8],
fds: &[BorrowedFd<'_>]
) -> Result<usize>
pub fn write_with_fd( &mut self, buf: &[u8], fds: &[BorrowedFd<'_>] ) -> Result<usize>
Write data, with additional pass file descriptors. For most of the unix
systems, file descriptors must be sent along with at least one byte
of data. This is why there is not a write_fd
method.
Trait Implementations§
source§impl AsyncRead for WithFd<Async<UnixStream>>
Available on crate feature async-io
only.
impl AsyncRead for WithFd<Async<UnixStream>>
async-io
only.source§impl AsyncRead for WithFd<UnixStream>
Available on crate feature tokio
only.
impl AsyncRead for WithFd<UnixStream>
tokio
only.source§impl<T> AsyncWrite for &WithFd<Async<T>>where
for<'a> &'a Async<T>: AsyncWrite,
Available on crate feature async-io
only.
impl<T> AsyncWrite for &WithFd<Async<T>>where
for<'a> &'a Async<T>: AsyncWrite,
async-io
only.source§fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
source§fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
source§impl<T> AsyncWrite for WithFd<Async<T>>where
Async<T>: AsyncWrite,
Available on crate feature async-io
only.
impl<T> AsyncWrite for WithFd<Async<T>>where
Async<T>: AsyncWrite,
async-io
only.source§fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
source§fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<()>>
source§impl AsyncWrite for WithFd<UnixStream>
Available on crate feature tokio
only.
impl AsyncWrite for WithFd<UnixStream>
tokio
only.source§fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize, Error>>
fn poll_write( self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8] ) -> Poll<Result<usize, Error>>
buf
into the object. Read moresource§fn poll_flush(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<(), Error>>
source§fn poll_shutdown(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<(), Error>>
fn poll_shutdown( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<(), Error>>
source§fn poll_write_vectored(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
bufs: &[IoSlice<'_>]
) -> Poll<Result<usize, Error>>
fn poll_write_vectored( self: Pin<&mut Self>, cx: &mut Context<'_>, bufs: &[IoSlice<'_>] ) -> Poll<Result<usize, Error>>
poll_write
, except that it writes from a slice of buffers. Read moresource§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
poll_write_vectored
implementation. Read moresource§impl From<Async<UnixStream>> for WithFd<Async<UnixStream>>
Available on crate feature async-io
only.
impl From<Async<UnixStream>> for WithFd<Async<UnixStream>>
async-io
only.source§fn from(inner: Async<UnixStream>) -> Self
fn from(inner: Async<UnixStream>) -> Self
source§impl From<UnixStream> for WithFd<UnixStream>
impl From<UnixStream> for WithFd<UnixStream>
source§fn from(inner: UnixStream) -> Self
fn from(inner: UnixStream) -> Self
source§impl From<UnixStream> for WithFd<UnixStream>
Available on crate feature tokio
only.
impl From<UnixStream> for WithFd<UnixStream>
tokio
only.source§fn from(inner: UnixStream) -> Self
fn from(inner: UnixStream) -> Self
source§impl Read for WithFd<UnixStream>
impl Read for WithFd<UnixStream>
source§fn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
1.36.0 · source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read
, except that it reads into a slice of buffers. Read moresource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector
)1.0.0 · source§fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
buf
. Read more1.0.0 · source§fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
buf
. Read more1.6.0 · source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
buf
. Read moresource§fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
read_buf
)source§fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
read_buf
)cursor
. Read more1.0.0 · source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Read
. Read moresource§impl Write for WithFd<UnixStream>
impl Write for WithFd<UnixStream>
source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
source§fn write_all(&mut self, buf: &[u8]) -> Result<()>
fn write_all(&mut self, buf: &[u8]) -> Result<()>
source§fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()>
fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()>
source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)