pub struct OwnedHandle { /* private fields */ }
Expand description
An owned handle.
This closes the handle on drop.
Note that it may have the value INVALID_HANDLE_VALUE
(-1), which is
sometimes a valid handle 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
sourceimpl OwnedHandle
impl OwnedHandle
Trait Implementations
sourceimpl AsHandle for OwnedHandle
impl AsHandle for OwnedHandle
sourceimpl AsRawHandle for OwnedHandle
impl AsRawHandle for OwnedHandle
sourcefn as_raw_handle(&self) -> RawHandle
fn as_raw_handle(&self) -> RawHandle
Extracts the raw handle, without taking any ownership.
sourceimpl Debug for OwnedHandle
impl Debug for OwnedHandle
sourceimpl Drop for OwnedHandle
impl Drop for OwnedHandle
sourceimpl From<Child> for OwnedHandle
impl From<Child> for OwnedHandle
sourcefn from(child: Child) -> OwnedHandle
fn from(child: Child) -> OwnedHandle
Performs the conversion.
sourceimpl From<ChildStderr> for OwnedHandle
impl From<ChildStderr> for OwnedHandle
sourcefn from(child_stderr: ChildStderr) -> OwnedHandle
fn from(child_stderr: ChildStderr) -> OwnedHandle
Performs the conversion.
sourceimpl From<ChildStdin> for OwnedHandle
impl From<ChildStdin> for OwnedHandle
sourcefn from(child_stdin: ChildStdin) -> OwnedHandle
fn from(child_stdin: ChildStdin) -> OwnedHandle
Performs the conversion.
sourceimpl From<ChildStdout> for OwnedHandle
impl From<ChildStdout> for OwnedHandle
sourcefn from(child_stdout: ChildStdout) -> OwnedHandle
fn from(child_stdout: ChildStdout) -> OwnedHandle
Performs the conversion.
sourceimpl From<File> for OwnedHandle
impl From<File> for OwnedHandle
sourcefn from(file: File) -> OwnedHandle
fn from(file: File) -> OwnedHandle
Performs the conversion.
sourceimpl<T> From<JoinHandle<T>> for OwnedHandle
impl<T> From<JoinHandle<T>> for OwnedHandle
sourcefn from(join_handle: JoinHandle<T>) -> OwnedHandle
fn from(join_handle: JoinHandle<T>) -> OwnedHandle
Performs the conversion.
sourceimpl From<OwnedHandle> for File
impl From<OwnedHandle> for File
sourcefn from(owned: OwnedHandle) -> Self
fn from(owned: OwnedHandle) -> Self
Performs the conversion.
sourceimpl From<OwnedHandle> for Stdio
impl From<OwnedHandle> for Stdio
sourcefn from(handle: OwnedHandle) -> Stdio
fn from(handle: OwnedHandle) -> Stdio
Performs the conversion.
sourceimpl FromRawHandle for OwnedHandle
impl FromRawHandle for OwnedHandle
sourceunsafe fn from_raw_handle(handle: RawHandle) -> Self
unsafe fn from_raw_handle(handle: RawHandle) -> Self
Constructs a new instance of Self
from the given raw handle.
Safety
The resource pointed to by handle
must be open and suitable for
assuming ownership. The resource must not require any cleanup other
than CloseHandle
.
In particular, it must not be used with handles to open registry
keys which need to be closed with RegCloseKey
instead.
Note that it may have the value INVALID_HANDLE_VALUE
(-1), which is
sometimes a valid handle value. See here for the full story.
sourceimpl IntoRawHandle for OwnedHandle
impl IntoRawHandle for OwnedHandle
sourcefn into_raw_handle(self) -> RawHandle
fn into_raw_handle(self) -> RawHandle
Consumes this object, returning the raw underlying handle. Read more
sourceimpl TryFrom<HandleOrInvalid> for OwnedHandle
impl TryFrom<HandleOrInvalid> for OwnedHandle
sourceimpl TryFrom<HandleOrNull> for OwnedHandle
impl TryFrom<HandleOrNull> for OwnedHandle
impl Send for OwnedHandle
impl Sync for OwnedHandle
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more