Struct winsafe::guard::UnmapViewOfFileGuard
source · pub struct UnmapViewOfFileGuard { /* private fields */ }
Available on crate feature
kernel
only.Expand description
RAII implementation for HFILEMAPVIEW
which
automatically calls
UnmapViewOfFile
when the object goes out of scope.
Implementations§
source§impl UnmapViewOfFileGuard
impl UnmapViewOfFileGuard
sourcepub const unsafe fn new(handle: HFILEMAPVIEW) -> Self
pub const unsafe fn new(handle: HFILEMAPVIEW) -> Self
Constructs the guard by taking ownership of the handle.
This method can be used as an escape hatch to interoperate with other libraries.
§Safety
Be sure the handle must be freed with the specified function at the end of scope.
sourcepub fn leak(&mut self) -> HFILEMAPVIEW
pub fn leak(&mut self) -> HFILEMAPVIEW
Ejects the underlying handle, leaving a
Handle::INVALID
in its
place.
Since the internal handle will be invalidated, the destructor will not run. It’s your responsability to run it, otherwise you’ll cause a resource leak.
Trait Implementations§
source§impl Deref for UnmapViewOfFileGuard
impl Deref for UnmapViewOfFileGuard
source§impl DerefMut for UnmapViewOfFileGuard
impl DerefMut for UnmapViewOfFileGuard
Auto Trait Implementations§
impl RefUnwindSafe for UnmapViewOfFileGuard
impl Send for UnmapViewOfFileGuard
impl !Sync for UnmapViewOfFileGuard
impl Unpin for UnmapViewOfFileGuard
impl UnwindSafe for UnmapViewOfFileGuard
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more