Checks if the respective entry is currently cached. If the entry has expired by `now` it is removed from the cache. The LRU queue is not updated.
(&mut self, k: &TableScopedPath, now: Instant)
| 221 | /// |
| 222 | /// The LRU queue is not updated. |
| 223 | fn contains_key(&mut self, k: &TableScopedPath, now: Instant) -> bool { |
| 224 | let Some(entry) = self.lru_queue.peek(k) else { |
| 225 | return false; |
| 226 | }; |
| 227 | |
| 228 | match entry.expires { |
| 229 | Some(exp) if now > exp => { |
| 230 | self.remove(k); |
| 231 | false |
| 232 | } |
| 233 | _ => true, |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | /// Adds a new key-value pair to cache expiring at `now` + the TTL. |
| 238 | /// |