pub fn enter<R>(self, child_fn: impl FnOnce() -> R) -> R {
        let _reset_when_done_please = CURRENT_SCOPE.with(|parent| {
            let mut parent = parent.borrow_mut();
            let parent = replace(&mut *parent, Rc::new(self));

            scopeguard::guard(parent, move |prev| {
                CURRENT_SCOPE.with(|p| p.replace(prev));
            })
        });

        // call this out here so these calls can be nested
        child_fn()
    }
/// Call `child_fn` with this environment as the current scope.
Call `child_fn` with this environment as the current scope.
Call ` child_fn ` with this environment as the current scope .
pub fn enter<R>(self, child_fn: impl FnOnce() -> R) -> R {
        let _reset_when_done_please = CURRENT_SCOPE.with(|parent| {
            let mut parent = parent.borrow_mut();
            let parent = replace(&mut *parent, Rc::new(self));
            scopeguard::guard(parent, move |prev| {
                CURRENT_SCOPE.with(|p| p.replace(prev));
            })
        });
        // call this out here so these calls can be nested
        child_fn()
    }
pub fn enter < R > ( self , child_fn : impl FnOnce ( ) -> R ) -> R { let _reset_when_done_please = CURRENT_SCOPE . with ( | parent | { let mut parent = parent . borrow_mut ( ) ; let parent = replace ( & mut * parent , Rc :: new ( self ) ) ; scopeguard :: guard ( parent , move | prev | { CURRENT_SCOPE . with ( | p | p . replace ( prev ) ) ; } ) } ) ; // call this out here so these calls can be nested child_fn ( ) }
Call `child_fn` with this environment as the current scope.
Call ` child_fn ` with this environment as the current scope .
self
child_fn
impl FnOnce() -> R
self
child_fn
impl FnOnce() -> R