Struct winsafe::guard::DestroyIconSiiGuard
source · pub struct DestroyIconSiiGuard { /* private fields */ }
Available on crate features
kernel
and shell
only.Expand description
RAII implementation for SHSTOCKICONINFO
which
automatically calls
DestroyIcon
on hIcon
field when the object goes out of scope.
Implementations§
source§impl DestroyIconSiiGuard
impl DestroyIconSiiGuard
sourcepub const unsafe fn new(sii: SHSTOCKICONINFO) -> Self
pub const unsafe fn new(sii: SHSTOCKICONINFO) -> Self
Constructs the guard by taking ownership of the struct.
§Safety
Be sure the handle must be freed with
DestroyIcon
at the end of scope.
sourcepub fn leak(&mut self) -> SHSTOCKICONINFO
pub fn leak(&mut self) -> SHSTOCKICONINFO
Ejects the underlying struct, leaving
SHSTOCKICONINFO::default
in its
place.
Since the internal handle will be invalidated, the destructor will not run. It’s your responsibility to run it, otherwise you’ll cause a resource leak.
Methods from Deref<Target = SHSTOCKICONINFO>§
sourcepub fn get_szPath(&mut self, text: &str)
pub fn get_szPath(&mut self, text: &str)
Sets the string field.
Trait Implementations§
source§impl Deref for DestroyIconSiiGuard
impl Deref for DestroyIconSiiGuard
source§impl DerefMut for DestroyIconSiiGuard
impl DerefMut for DestroyIconSiiGuard
Auto Trait Implementations§
impl RefUnwindSafe for DestroyIconSiiGuard
impl Send for DestroyIconSiiGuard
impl !Sync for DestroyIconSiiGuard
impl Unpin for DestroyIconSiiGuard
impl UnwindSafe for DestroyIconSiiGuard
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