OwnedFd in std::os::fd - Rust (original) (raw)
Struct OwnedFd
1.66.0 · Source
pub struct OwnedFd { /* private fields */ }
Expand description
An owned file descriptor.
This closes the file descriptor on drop. It is guaranteed that nobody else will close the file descriptor.
This uses repr(transparent)
and has the representation of a host file descriptor, so it can be used in FFI in places where a file descriptor is passed as a consumed argument or returned as an owned value, and it never has the value -1
.
You can use AsFd::as_fd to obtain a BorrowedFd.
1.63.0 · Source
Creates a new OwnedFd
instance that shares the same underlying file description as the existing OwnedFd
instance.
Available on Unix only.
Available on Unix only.
Available on Unix only.
Takes ownership of a File’s underlying file descriptor.
Available on Unix only.
Creates a ChildStderr
from the provided OwnedFd
.
The provided file descriptor must point to a pipe with the CLOEXEC
flag set.
Converts to this type from the input type.
Available on Unix only.
Creates a ChildStdin
from the provided OwnedFd
.
The provided file descriptor must point to a pipe with the CLOEXEC
flag set.
Converts to this type from the input type.
Available on Unix only.
Creates a ChildStdout
from the provided OwnedFd
.
The provided file descriptor must point to a pipe with the CLOEXEC
flag set.
Converts to this type from the input type.
Returns a File that takes ownership of the given file descriptor.
Available on Linux only.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Available on Unix only.
Takes ownership of a file descriptor and returns a Stdiothat can attach a stream to it.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Available on Unix only.
Converts to this type from the input type.
Available on Unix only.
Converts to this type from the input type.
Available on Unix only.
Converts to this type from the input type.
Available on Linux only.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Available on Unix only.
Available on Unix only.
Available on Unix only.
Constructs a new instance of Self
from the given raw file descriptor.
§Safety
The resource pointed to by fd
must be open and suitable for assumingownership. The resource must not require any cleanup other than close
.
Consumes this object, returning the raw underlying file descriptor. Read more
Returns true
if the descriptor/handle refers to a terminal/tty. Read more