Struct winsafe::guard::EndUpdateResourceGuard
source · pub struct EndUpdateResourceGuard { /* private fields */ }
Available on crate feature
kernel
only.Expand description
RAII implementation HUPDATERSRC
which automatically
calls
EndUpdateResource
when the object goes out of scope.
Implementations§
source§impl EndUpdateResourceGuard
impl EndUpdateResourceGuard
sourcepub const unsafe fn new(hupsrc: HUPDATERSRC) -> Self
pub const unsafe fn new(hupsrc: HUPDATERSRC) -> Self
Constructs the guard by taking ownership of the handle.
§Safety
Be sure the handle must be freed with
EndUpdateResource
at the end of scope.
sourcepub fn leak(&mut self) -> HUPDATERSRC
pub fn leak(&mut self) -> HUPDATERSRC
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 EndUpdateResourceGuard
impl Deref for EndUpdateResourceGuard
source§impl DerefMut for EndUpdateResourceGuard
impl DerefMut for EndUpdateResourceGuard
Auto Trait Implementations§
impl Freeze for EndUpdateResourceGuard
impl RefUnwindSafe for EndUpdateResourceGuard
impl Send for EndUpdateResourceGuard
impl !Sync for EndUpdateResourceGuard
impl Unpin for EndUpdateResourceGuard
impl UnwindSafe for EndUpdateResourceGuard
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