pub struct DeferGuard<F: FnOnce()>(pub Option<F>);
Expand description
Executes the wrapped closure on drop.
Should be used together with the crate::defer!
macro.
Tuple Fields§
§0: Option<F>
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for DeferGuard<F>where
F: Freeze,
impl<F> RefUnwindSafe for DeferGuard<F>where
F: RefUnwindSafe,
impl<F> Send for DeferGuard<F>where
F: Send,
impl<F> Sync for DeferGuard<F>where
F: Sync,
impl<F> Unpin for DeferGuard<F>where
F: Unpin,
impl<F> UnwindSafe for DeferGuard<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