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