Struct winsafe::guard::EndDeferWindowPosGuard
source · pub struct EndDeferWindowPosGuard { /* private fields */ }
Available on crate features
kernel
and user
only.Expand description
RAII implementation for HDWP
which automatically calls
EndDeferWindowPos
when the object goes out of scope.
Implementations§
source§impl EndDeferWindowPosGuard
impl EndDeferWindowPosGuard
sourcepub const unsafe fn new(handle: HDWP) -> Self
pub const unsafe fn new(handle: HDWP) -> 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) -> HDWP
pub fn leak(&mut self) -> HDWP
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 EndDeferWindowPosGuard
impl Deref for EndDeferWindowPosGuard
source§impl DerefMut for EndDeferWindowPosGuard
impl DerefMut for EndDeferWindowPosGuard
Auto Trait Implementations§
impl Freeze for EndDeferWindowPosGuard
impl RefUnwindSafe for EndDeferWindowPosGuard
impl Send for EndDeferWindowPosGuard
impl !Sync for EndDeferWindowPosGuard
impl Unpin for EndDeferWindowPosGuard
impl UnwindSafe for EndDeferWindowPosGuard
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