Struct winsafe::guard::DeleteDCGuard
source · pub struct DeleteDCGuard { /* private fields */ }
Available on crate features
kernel
and gdi
only.Expand description
Implementations§
source§impl DeleteDCGuard
impl DeleteDCGuard
sourcepub const unsafe fn new(handle: HDC) -> Self
pub const unsafe fn new(handle: HDC) -> 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) -> HDC
pub fn leak(&mut self) -> HDC
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 DeleteDCGuard
impl Deref for DeleteDCGuard
source§impl DerefMut for DeleteDCGuard
impl DerefMut for DeleteDCGuard
Auto Trait Implementations§
impl Freeze for DeleteDCGuard
impl RefUnwindSafe for DeleteDCGuard
impl Send for DeleteDCGuard
impl !Sync for DeleteDCGuard
impl Unpin for DeleteDCGuard
impl UnwindSafe for DeleteDCGuard
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