/// Returns a snapshot of the current dynamic scope. Most useful for
/// debugging the contained `Env`.
Returns a snapshot of the current dynamic scope. Most useful for
debugging the contained `Env`.
Returns a snapshot of the current dynamic scope . Most useful for debugging the contained ` Env ` .
pub fn snapshot() -> EnvSnapshot {
        let mut stacked = EnvSnapshot { by_depth: BTreeMap::new() };
        CURRENT_SCOPE.with(|e| {
            for (_, anon) in &e.borrow().values {
                stacked
                    .by_depth
                    .entry(anon.depth())
                    .or_insert_with(|| Env {
                        values: Default::default(),
                        depth: anon.depth(),
                        location: anon.location(), // depth -> location is 1:1
                    })
                    .add_anon(anon.clone());
            }
        });
        stacked
    }
pub fn snapshot ( ) -> EnvSnapshot { let mut stacked = EnvSnapshot { by_depth : BTreeMap :: new ( ) } ; CURRENT_SCOPE . with ( | e | { for ( _ , anon ) in & e . borrow ( ) . values { stacked . by_depth . entry ( anon . depth ( ) ) . or_insert_with ( | | Env { values : Default :: default ( ) , depth : anon . depth ( ) , location : anon . location ( ) , // depth -> location is 1:1 } ) . add_anon ( anon . clone ( ) ) ; } } ) ; stacked }
Returns a snapshot of the current dynamic scope.
Returns a snapshot of the current dynamic scope .