Returns the respective entry from the cache, if it exists. If the entry exists, it becomes the most recently used.
(&mut self, k: &Path)
| 46 | /// Returns the respective entry from the cache, if it exists. |
| 47 | /// If the entry exists, it becomes the most recently used. |
| 48 | fn get(&mut self, k: &Path) -> Option<CachedFileMetadataEntry> { |
| 49 | self.lru_queue.get(k).cloned().inspect(|_| { |
| 50 | *self.cache_hits.entry(k.clone()).or_insert(0) += 1; |
| 51 | }) |
| 52 | } |
| 53 | |
| 54 | /// Checks if the metadata is currently cached. |
| 55 | /// The LRU queue is not updated. |