OwnedHandle in std::os::windows::io - Rust (original) (raw)

Struct OwnedHandle

1.63.0 · Source

pub struct OwnedHandle { /* private fields */ }

Available on Windows only.

Expand description

An owned handle.

This closes the handle on drop.

Note that it may have the value -1, which in OwnedHandle always represents a valid handle value, such as the current process handle, and not INVALID_HANDLE_VALUE, despite the two having the same value. Seehere for the full story.

And, it may have the value NULL (0), which can occur when consoles are detached from processes, or when windows_subsystem is used.

OwnedHandle uses CloseHandle to close its handle on drop. As such, it must not be used with handles to open registry keys which need to be closed with RegCloseKey instead.

Source§

1.63.0 · Source

Creates a new OwnedHandle instance that shares the same underlying object as the existing OwnedHandle instance.

1.63.0 · Source§

1.63.0 · Source§

1.63.0 · Source§

1.63.0 · Source§

1.63.0 · Source§

1.63.0 · Source§

1.63.0 · Source§

1.63.0 · Source§

1.63.0 · Source§

Source§

Takes ownership of a File’s underlying file handle.

1.63.0 · Source§

Source§

Converts to this type from the input type.

1.74.0 · Source§

Creates a ChildStderr from the provided OwnedHandle.

The provided handle must be asynchronous, as reading and writing from and to it is implemented using asynchronous APIs.

Source§

Converts to this type from the input type.

1.74.0 · Source§

Creates a ChildStdin from the provided OwnedHandle.

The provided handle must be asynchronous, as reading and writing from and to it is implemented using asynchronous APIs.

Source§

Converts to this type from the input type.

1.74.0 · Source§

Creates a ChildStdout from the provided OwnedHandle.

The provided handle must be asynchronous, as reading and writing from and to it is implemented using asynchronous APIs.

Source§

Converts to this type from the input type.

1.63.0 · Source§

Source§

Returns a File that takes ownership of the given handle.

1.63.0 · Source§

Source§

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

1.63.0 · Source§

1.63.0 · Source§

1.70.0 · Source§

Source§

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

1.63.0 · Source§

Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

1.63.0 · Source§

Source§

The type returned in the event of a conversion error.

Source§

Performs the conversion.

1.63.0 · Source§

1.63.0 · Source§

§

§

§

§