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

Method get

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

Get an entry from the cache, updating its access time. Returns `None` if the key is not in the cache.

(&mut self, key: &K)

Source from the content-addressed store, hash-verified

50 ///
51 /// Returns `None` if the key is not in the cache.
52 pub(crate) fn get(&mut self, key: &K) -> Option<&V> {
53 if let Some(entry) = self.entries.get_mut(key) {
54 self.access_counter += 1;
55 entry.last_access = self.access_counter;
56 Some(&entry.value)
57 } else {
58 None
59 }
60 }
61
62 /// Read an entry without updating its access time.
63 ///

Callers

nothing calls this directly

Calls 1

get_mutMethod · 0.80

Tested by

no test coverage detected