Removes an entry from the cache and returns it, if it exists.
(&mut self, k: &TableScopedPath)
| 284 | |
| 285 | /// Removes an entry from the cache and returns it, if it exists. |
| 286 | fn remove(&mut self, k: &TableScopedPath) -> Option<CachedFileList> { |
| 287 | if let Some(entry) = self.lru_queue.remove(k) { |
| 288 | self.memory_used -= entry.size_bytes; |
| 289 | Some(entry.metas) |
| 290 | } else { |
| 291 | None |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | /// Returns the number of entries currently cached. |
| 296 | fn len(&self) -> usize { |
no outgoing calls