#[repr(transparent)]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
impl AsHandle for OwnedHandle
source
impl AsHandle for OwnedHandle
sourceimpl AsRawHandle for OwnedHandle
source
impl AsRawHandle for OwnedHandle
sourcefn as_raw_handle(&self) -> RawHandle
source
fn as_raw_handle(&self) -> RawHandle
sourceExtracts the raw handle. Read more
impl Debug for OwnedHandle
source
impl Debug for OwnedHandle
sourceimpl Drop for OwnedHandle
source
impl Drop for OwnedHandle
sourceimpl From<Child> for OwnedHandle
source
impl From<Child> for OwnedHandle
sourcefn from(child: Child) -> OwnedHandle
source
fn from(child: Child) -> OwnedHandle
sourceConverts to this type from the input type.
impl From<ChildStderr> for OwnedHandle
source
impl From<ChildStderr> for OwnedHandle
sourcefn from(child_stderr: ChildStderr) -> OwnedHandle
source
fn from(child_stderr: ChildStderr) -> OwnedHandle
sourceConverts to this type from the input type.
impl From<ChildStdin> for OwnedHandle
source
impl From<ChildStdin> for OwnedHandle
sourcefn from(child_stdin: ChildStdin) -> OwnedHandle
source
fn from(child_stdin: ChildStdin) -> OwnedHandle
sourceConverts to this type from the input type.
impl From<ChildStdout> for OwnedHandle
source
impl From<ChildStdout> for OwnedHandle
sourcefn from(child_stdout: ChildStdout) -> OwnedHandle
source
fn from(child_stdout: ChildStdout) -> OwnedHandle
sourceConverts to this type from the input type.
impl From<File> for OwnedHandle
source
impl From<File> for OwnedHandle
sourcefn from(file: File) -> OwnedHandle
source
fn from(file: File) -> OwnedHandle
sourceConverts to this type from the input type.
impl<T> From<JoinHandle<T>> for OwnedHandle
source
impl<T> From<JoinHandle<T>> for OwnedHandle
sourcefn from(join_handle: JoinHandle<T>) -> OwnedHandle
source
fn from(join_handle: JoinHandle<T>) -> OwnedHandle
sourceConverts to this type from the input type.
impl From<OwnedHandle> for File
source
impl From<OwnedHandle> for File
sourcefn from(owned: OwnedHandle) -> Self
source
fn from(owned: OwnedHandle) -> Self
sourceConverts to this type from the input type.
impl From<OwnedHandle> for Stdio
source
impl From<OwnedHandle> for Stdio
sourcefn from(handle: OwnedHandle) -> Stdio
source
fn from(handle: OwnedHandle) -> Stdio
sourceConverts to this type from the input type.
impl FromRawHandle for OwnedHandle
source
impl FromRawHandle for OwnedHandle
sourceunsafe fn from_raw_handle(handle: RawHandle) -> Self
source
unsafe fn from_raw_handle(handle: RawHandle) -> Self
sourceConstructs a new I/O object from the specified raw handle. Read more
impl IntoRawHandle for OwnedHandle
source
impl IntoRawHandle for OwnedHandle
sourcefn into_raw_handle(self) -> RawHandle
source
fn into_raw_handle(self) -> RawHandle
sourceConsumes this object, returning the raw underlying handle. Read more
impl TryFrom<HandleOrInvalid> for OwnedHandle
source
impl TryFrom<HandleOrInvalid> for OwnedHandle
sourcetype Error = InvalidHandleError
type Error = InvalidHandleError
The type returned in the event of a conversion error.
fn try_from(
handle_or_invalid: HandleOrInvalid
) -> Result<Self, InvalidHandleError>
source
fn try_from(
handle_or_invalid: HandleOrInvalid
) -> Result<Self, InvalidHandleError>
sourcePerforms the conversion.
impl TryFrom<HandleOrNull> for OwnedHandle
source
impl TryFrom<HandleOrNull> for OwnedHandle
sourcetype Error = NullHandleError
type Error = NullHandleError
The type returned in the event of a conversion error.
fn try_from(handle_or_null: HandleOrNull) -> Result<Self, NullHandleError>
source
fn try_from(handle_or_null: HandleOrNull) -> Result<Self, NullHandleError>
sourcePerforms the conversion.
impl Send for OwnedHandle
sourceimpl Sync for OwnedHandle
sourceAuto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
source
impl<T> BorrowMut<T> for T where
T: ?Sized,
sourcefn borrow_mut(&mut self) -> &mut T
const: unstable · source
fn borrow_mut(&mut self) -> &mut T
const: unstable · sourceMutably borrows from an owned value. Read more