Retrieve a cloned VirtualFile entry if virtual files are enabled.
(&self, path: &Path)
| 430 | |
| 431 | /// Retrieve a cloned VirtualFile entry if virtual files are enabled. |
| 432 | fn get_virtual_entry(&self, path: &Path) -> Option<VirtualFile> { |
| 433 | if !self.has_virtual_files.load(Ordering::Relaxed) { |
| 434 | return None; |
| 435 | } |
| 436 | let files = self.virtual_files.read().unwrap(); |
| 437 | let res = self.get_virtual_file(path, &files).cloned(); |
| 438 | if res.is_some() { |
| 439 | crate::perf::count(Counter::VirtualFileHits, 1); |
| 440 | } |
| 441 | res |
| 442 | } |
| 443 | |
| 444 | /// Iterate over all virtual file paths, as the caller spelled them. |
| 445 | pub fn for_each_virtual_path<F>(&self, mut f: F) |