Read an entry without updating its access time. This is safe to call with only a shared reference (`&self`), making it suitable for use behind a `RwLock::read()` guard. The trade-off is that accessed entries don't get promoted in the LRU order, but this is acceptable when the alternative is serializing all readers on a write lock.
(&self, key: &K)
| 67 | /// the LRU order, but this is acceptable when the alternative |
| 68 | /// is serializing all readers on a write lock. |
| 69 | pub(crate) fn peek(&self, key: &K) -> Option<&V> { |
| 70 | self.entries.get(key).map(|entry| &entry.value) |
| 71 | } |
| 72 | |
| 73 | /// Insert an entry into the cache. |
| 74 | /// |
no test coverage detected