pub struct OwnedHandle { /* private fields */ }
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. See
here 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.
Implementationsยง
Trait Implementationsยง
1.63.0 ยท Sourceยงimpl AsHandle for OwnedHandle
impl AsHandle for OwnedHandle
Sourceยงfn as_handle(&self) -> BorrowedHandle<'_>
fn as_handle(&self) -> BorrowedHandle<'_>
1.63.0 ยท Sourceยงimpl AsRawHandle for OwnedHandle
impl AsRawHandle for OwnedHandle
Sourceยงfn as_raw_handle(&self) -> RawHandle
fn as_raw_handle(&self) -> RawHandle
1.63.0 ยท Sourceยงimpl Debug for OwnedHandle
impl Debug for OwnedHandle
1.63.0 ยท Sourceยงimpl Drop for OwnedHandle
impl Drop for OwnedHandle
1.63.0 ยท Sourceยงimpl From<Child> for OwnedHandle
impl From<Child> for OwnedHandle
1.63.0 ยท Sourceยงimpl From<ChildStderr> for OwnedHandle
impl From<ChildStderr> for OwnedHandle
Sourceยงfn from(child_stderr: ChildStderr) -> OwnedHandle
fn from(child_stderr: ChildStderr) -> OwnedHandle
Takes ownership of a ChildStderr
โs file handle.
1.63.0 ยท Sourceยงimpl From<ChildStdin> for OwnedHandle
impl From<ChildStdin> for OwnedHandle
Sourceยงfn from(child_stdin: ChildStdin) -> OwnedHandle
fn from(child_stdin: ChildStdin) -> OwnedHandle
Takes ownership of a ChildStdin
โs file handle.
1.63.0 ยท Sourceยงimpl From<ChildStdout> for OwnedHandle
impl From<ChildStdout> for OwnedHandle
Sourceยงfn from(child_stdout: ChildStdout) -> OwnedHandle
fn from(child_stdout: ChildStdout) -> OwnedHandle
Takes ownership of a ChildStdout
โs file handle.
1.63.0 ยท Sourceยงimpl From<File> for OwnedHandle
impl From<File> for OwnedHandle
1.63.0 ยท Sourceยงimpl<T> From<JoinHandle<T>> for OwnedHandle
impl<T> From<JoinHandle<T>> for OwnedHandle
Sourceยงfn from(join_handle: JoinHandle<T>) -> OwnedHandle
fn from(join_handle: JoinHandle<T>) -> OwnedHandle
1.74.0 ยท Sourceยงimpl From<OwnedHandle> for ChildStderr
Creates a ChildStderr
from the provided OwnedHandle
.
impl From<OwnedHandle> for ChildStderr
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ยงfn from(handle: OwnedHandle) -> ChildStderr โ
fn from(handle: OwnedHandle) -> ChildStderr โ
1.74.0 ยท Sourceยงimpl From<OwnedHandle> for ChildStdin
Creates a ChildStdin
from the provided OwnedHandle
.
impl From<OwnedHandle> for ChildStdin
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ยงfn from(handle: OwnedHandle) -> ChildStdin โ
fn from(handle: OwnedHandle) -> ChildStdin โ
1.74.0 ยท Sourceยงimpl From<OwnedHandle> for ChildStdout
Creates a ChildStdout
from the provided OwnedHandle
.
impl From<OwnedHandle> for ChildStdout
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ยงfn from(handle: OwnedHandle) -> ChildStdout โ
fn from(handle: OwnedHandle) -> ChildStdout โ
1.63.0 ยท Sourceยงimpl From<OwnedHandle> for File
impl From<OwnedHandle> for File
Sourceยงfn from(owned: OwnedHandle) -> Self
fn from(owned: OwnedHandle) -> Self
Returns a File
that takes ownership of the given handle.
1.87.0 ยท Sourceยงimpl From<OwnedHandle> for PipeReader
impl From<OwnedHandle> for PipeReader
Sourceยงfn from(owned_handle: OwnedHandle) -> Self
fn from(owned_handle: OwnedHandle) -> Self
1.87.0 ยท Sourceยงimpl From<OwnedHandle> for PipeWriter
impl From<OwnedHandle> for PipeWriter
Sourceยงfn from(owned_handle: OwnedHandle) -> Self
fn from(owned_handle: OwnedHandle) -> Self
1.63.0 ยท Sourceยงimpl From<OwnedHandle> for Stdio
impl From<OwnedHandle> for Stdio
1.87.0 ยท Sourceยงimpl From<PipeReader> for OwnedHandle
impl From<PipeReader> for OwnedHandle
Sourceยงfn from(pipe: PipeReader) -> Self
fn from(pipe: PipeReader) -> Self
1.87.0 ยท Sourceยงimpl From<PipeWriter> for OwnedHandle
impl From<PipeWriter> for OwnedHandle
Sourceยงfn from(pipe: PipeWriter) -> Self
fn from(pipe: PipeWriter) -> Self
1.63.0 ยท Sourceยงimpl FromRawHandle for OwnedHandle
impl FromRawHandle for OwnedHandle
Sourceยงunsafe fn from_raw_handle(handle: RawHandle) -> Self
unsafe fn from_raw_handle(handle: RawHandle) -> Self
1.63.0 ยท Sourceยงimpl IntoRawHandle for OwnedHandle
impl IntoRawHandle for OwnedHandle
Sourceยงfn into_raw_handle(self) -> RawHandle
fn into_raw_handle(self) -> RawHandle
1.70.0 ยท Sourceยงimpl IsTerminal for OwnedHandle
impl IsTerminal for OwnedHandle
Sourceยงfn is_terminal(&self) -> bool
fn is_terminal(&self) -> bool
true
if the descriptor/handle refers to a terminal/tty. Read more