MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / peek

Method peek

atomic-repository/src/changestore/cache.rs:69–71  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 ///

Callers 2

vault_kg_searchMethod · 0.45
copy_content_spanMethod · 0.45

Calls 1

getMethod · 0.65

Tested by

no test coverage detected