pub struct ScopeGuard<T, F: FnOnce(&mut T)> { /* private fields */ }Expand description
A guard which calls a callback to cleanup resources when it goes out of scope. Can be created
with the ScopeGuardBuilder.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T, F> Freeze for ScopeGuard<T, F>
impl<T, F> RefUnwindSafe for ScopeGuard<T, F>where
T: RefUnwindSafe,
F: RefUnwindSafe,
impl<T, F> Send for ScopeGuard<T, F>
impl<T, F> Sync for ScopeGuard<T, F>
impl<T, F> Unpin for ScopeGuard<T, F>
impl<T, F> UnwindSafe for ScopeGuard<T, F>where
T: UnwindSafe,
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