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.
1.63.0 · Source
Creates a new OwnedHandle
instance that shares the same underlying object as the existing OwnedHandle
instance.
Takes ownership of a File’s underlying file handle.
Converts to this type from the input type.
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.
Converts to this type from the input type.
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.
Converts to this type from the input type.
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.
Converts to this type from the input type.
Returns a File that takes ownership of the given handle.
Takes ownership of a handle and returns a Stdiothat can attach a stream to it.
Returns true
if the descriptor/handle refers to a terminal/tty. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.