Struct scopeguard::Guard
[−]
[src]
pub struct Guard<T, F> where F: FnMut(&mut T) {
// some fields omitted
}
Guard
is a scope guard that may own a protected value.
If you place a guard value in a local variable, its destructor will run regardless how you leave the function — regular return or panic (barring truly abnormal incidents).
The guard's closure will be called with a mut ref to the held value in the destructor. It's called only once.
Trait Implementations
impl<T, F> Deref for Guard<T, F> where F: FnMut(&mut T)
[src]
type Target = T
The resulting type after dereferencing
fn deref(&self) -> &T
The method called to dereference a value
impl<T, F> DerefMut for Guard<T, F> where F: FnMut(&mut T)
[src]
fn deref_mut(&mut self) -> &mut T
The method called to mutably dereference a value