Insert a key-value pair, using the given depth for the insertion. Removes existing entry and overwrites if already existed.
(&mut self, ctx: &C, key: K, value: V, depth: usize)
| 182 | /// insertion. Removes existing entry and overwrites if already |
| 183 | /// existed. |
| 184 | pub fn insert_with_depth<C>(&mut self, ctx: &C, key: K, value: V, depth: usize) |
| 185 | where |
| 186 | C: CtxEq<K, K> + CtxHash<K>, |
| 187 | { |
| 188 | let val = Val { |
| 189 | value, |
| 190 | level: depth as u32, |
| 191 | generation: self.generation_by_depth[depth], |
| 192 | }; |
| 193 | self.map.insert(key, val, ctx); |
| 194 | } |
| 195 | |
| 196 | /// Enter a new scope. |
| 197 | pub fn increment_depth(&mut self) { |
no test coverage detected