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