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]

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]

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]

Takes a (T, Hole<'c, 'm, T, F>) from an &'m mut T.

Auto Trait Implementations

impl<'s> !RefUnwindSafe for Scope<'s>

impl<'s> Send for Scope<'s>

impl<'s> !Sync for Scope<'s>

impl<'s> Unpin for Scope<'s>

impl<'s> !UnwindSafe for Scope<'s>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.