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