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