pub struct OnDrop<F>(/* private fields */)
where
F: FnOnce();Expand description
A utility struct that runs a cleanup function when dropped.
Implementations§
Source§impl<F> OnDrop<F>where
F: FnOnce() + 'static,
impl<F> OnDrop<F>where
F: FnOnce() + 'static,
Sourcepub fn attach(guard: impl WatcherGuard, f: F) -> impl WatcherGuard
pub fn attach(guard: impl WatcherGuard, f: F) -> impl WatcherGuard
Attaches a cleanup function to a guard.
Trait Implementations§
impl<F: FnOnce() + 'static> WatcherGuard for OnDrop<F>
Auto Trait Implementations§
impl<F> Freeze for OnDrop<F>
impl<F> RefUnwindSafe for OnDrop<F>where
Option<F>: RefUnwindSafe,
impl<F> Send for OnDrop<F>
impl<F> Sync for OnDrop<F>
impl<F> Unpin for OnDrop<F>
impl<F> UnsafeUnpin for OnDrop<F>where
Option<F>: UnsafeUnpin,
impl<F> UnwindSafe for OnDrop<F>where
Option<F>: UnwindSafe,
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