(&mut self, name: &'static str, id: ScopeId)
| 146 | } |
| 147 | |
| 148 | fn enter_with_id(&mut self, name: &'static str, id: ScopeId) -> (Guard, ScopeId) { |
| 149 | self.scopes.entry(id).or_insert_with(|| Scope::new(name)); |
| 150 | |
| 151 | // Insert as root, even it has a manually assigned parent to prevent child scopes from ending up as roots themselves |
| 152 | if self.scope_stack.is_empty() { |
| 153 | self.roots.insert(id); |
| 154 | } |
| 155 | |
| 156 | self.scope_stack.push(id); |
| 157 | (Guard::new(), id) |
| 158 | } |
| 159 | |
| 160 | /// Leave the scope at the top of the stack and increment its scope by the given duration |
| 161 | fn leave(&mut self, duration: Duration) { |
no test coverage detected