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.

Source§

1.63.0 · Source

Creates a new OwnedFd instance that shares the same underlying file description as the existing OwnedFd instance.

1.63.0 · Source§

1.63.0 · Source§

1.63.0 · Source§

1.63.0 · Source§

1.63.0 · Source§

Available on Unix only.

1.63.0 · Source§

Available on Unix only.

1.63.0 · Source§

Available on Unix only.

1.63.0 · Source§

Source§

Takes ownership of a File’s underlying file descriptor.

1.74.0 · Source§

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.

Source§

Converts to this type from the input type.

1.74.0 · Source§

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.

Source§

Converts to this type from the input type.

1.74.0 · Source§

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.

Source§

Converts to this type from the input type.

1.63.0 · Source§

Source§

Returns a File that takes ownership of the given file descriptor.

Source§

Available on Linux only.

Source§

Converts to this type from the input type.

Source§

Source§

Converts to this type from the input type.

Source§

Source§

Converts to this type from the input type.

1.63.0 · Source§

Available on Unix only.

Source§

Takes ownership of a file descriptor and returns a Stdiothat can attach a stream to it.

1.63.0 · Source§

Source§

Converts to this type from the input type.

1.63.0 · Source§

Source§

Converts to this type from the input type.

1.63.0 · Source§

Source§

Converts to this type from the input type.

1.63.0 · Source§

Available on Unix only.

Source§

Converts to this type from the input type.

1.63.0 · Source§

Available on Unix only.

Source§

Converts to this type from the input type.

1.63.0 · Source§

Available on Unix only.

Source§

Converts to this type from the input type.

Source§

Available on Linux only.

Source§

Converts to this type from the input type.

Source§

Source§

Converts to this type from the input type.

Source§

Source§

Converts to this type from the input type.

1.63.0 · Source§

1.63.0 · Source§

1.63.0 · Source§

1.63.0 · Source§

Available on Unix only.

1.63.0 · Source§

Available on Unix only.

1.63.0 · Source§

Available on Unix only.

1.63.0 · Source§

Source§

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.

1.63.0 · Source§

Source§

Consumes this object, returning the raw underlying file descriptor. Read more

1.70.0 · Source§

Source§

Returns true if the descriptor/handle refers to a terminal/tty. Read more

§

§

§

§

§

§