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>where
F: Freeze,
impl<F> RefUnwindSafe for OnDrop<F>where
F: RefUnwindSafe,
impl<F> Send for OnDrop<F>where
F: Send,
impl<F> Sync for OnDrop<F>where
F: Sync,
impl<F> Unpin for OnDrop<F>where
F: Unpin,
impl<F> UnwindSafe for OnDrop<F>where
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