Struct std::os::windows::io::BorrowedHandle [−][src]
#[repr(transparent)]pub struct BorrowedHandle<'handle> { /* fields omitted */ }
Expand description
A borrowed handle.
This has a lifetime parameter to tie it to the lifetime of something that owns the handle.
This uses repr(transparent)
and has the representation of a host handle,
so it can be used in FFI in places where a handle is passed as an argument,
it is not captured or consumed, and it is never null.
Note that it may have the value INVALID_HANDLE_VALUE
(-1), which is
sometimes a valid handle value. See here for the full story.
Implementations
Return a BorrowedHandle
holding the given raw handle.
Safety
The resource pointed to by handle
must be a valid open handle, it
must remain open for the duration of the returned BorrowedHandle
, and
it must not be null.
Note that it may have the value INVALID_HANDLE_VALUE
(-1), which is
sometimes a valid handle value. See here for the full story.
Trait Implementations
Extracts the raw handle, without taking any ownership.
Auto Trait Implementations
impl<'handle> RefUnwindSafe for BorrowedHandle<'handle>
impl<'handle> Unpin for BorrowedHandle<'handle>
impl<'handle> UnwindSafe for BorrowedHandle<'handle>
Blanket Implementations
Mutably borrows from an owned value. Read more