pub trait AsFd {
// Required method
fn as_fd(&self) -> BorrowedFd<'_>;
}
Expand description
A trait to borrow the file descriptor from an underlying object.
This is only available on unix platforms and must be imported in order to
call the method. Windows platforms have a corresponding AsHandle
and
AsSocket
set of traits.
Required Methods§
1.63.0 · sourcefn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor.
§Example
Implementors§
impl AsFd for File
impl AsFd for Stderr
impl AsFd for Stdin
impl AsFd for Stdout
impl AsFd for TcpListener
impl AsFd for TcpStream
impl AsFd for UdpSocket
impl AsFd for PipeReader
impl AsFd for PipeWriter
impl AsFd for ChildStderr
Available on Unix only.
impl AsFd for ChildStdin
Available on Unix only.
impl AsFd for ChildStdout
Available on Unix only.
impl AsFd for PidFd
Available on Linux only.
impl AsFd for UnixDatagram
Available on Unix only.
impl AsFd for UnixListener
Available on Unix only.
impl AsFd for UnixStream
Available on Unix only.