Helper method: get a copy of the current path. If [`PlanTrace::filter`] is set, this will also check the current path against the `find` entry and return `None` if the two differ.
(&self)
| 302 | /// If [`PlanTrace::filter`] is set, this will also check the current path |
| 303 | /// against the `find` entry and return `None` if the two differ. |
| 304 | fn current_path(&self) -> Option<String> { |
| 305 | let path = self.path.lock().expect("path shouldn't be poisoned"); |
| 306 | let path = path.as_str(); |
| 307 | match self.filter.as_ref() { |
| 308 | Some(named_paths) => { |
| 309 | if named_paths.iter().any(|named| path == named.path()) { |
| 310 | Some(path.to_owned()) |
| 311 | } else { |
| 312 | None |
| 313 | } |
| 314 | } |
| 315 | None => Some(path.to_owned()), |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | impl PlanTrace<UsedIndexes> { |