Struct io_lifetimes::OwnedHandle
source · [−]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.
Trait Implementations
Borrows the handle. Read more
Extracts the raw handle, without taking any ownership.
Constructs a new instance of Self
from the given raw handle.
Safety
The resource pointed to by raw
must be open and suitable for assuming
ownership.
Consumes this object, returning the underlying handle. Read more
Consumes this object, returning the raw underlying handle. Read more
Auto Trait Implementations
Blanket Implementations
Returns the raw value.
Mutably borrows from an owned value. Read more
Constructs Self
from the raw value.
Returns the raw value.