Struct take_mut::scoped::Scope [−][src]
pub struct Scope<'s> { /* fields omitted */ }Represents a scope within which, it is possible to take a T from a &mut T as long as the &mut T outlives the scope.
Implementations
impl<'s> Scope<'s>[src]
impl<'s> Scope<'s>[src]pub fn take_or_recover<'c, 'm: 's, T: 'm, F: FnOnce() -> T>(
&'c self,
mut_ref: &'m mut T,
recovery: F
) -> (T, Hole<'c, 'm, T, F>)[src]
&'c self,
mut_ref: &'m mut T,
recovery: F
) -> (T, Hole<'c, 'm, T, F>)
Takes a (T, Hole<'c, 'm, T, F>) from an &'m mut T.
If the Hole is dropped without being filled, either due to panic or forgetting to fill, will run the recovery function to obtain a T to fill itself with.
pub fn take<'c, 'm: 's, T: 'm>(
&'c self,
mut_ref: &'m mut T
) -> (T, Hole<'c, 'm, T, fn() -> T>)[src]
&'c self,
mut_ref: &'m mut T
) -> (T, Hole<'c, 'm, T, fn() -> T>)
Takes a (T, Hole<'c, 'm, T, F>) from an &'m mut T.