MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / get

Method get

code/chapter09/lru.rs:74–81  ·  view source on GitHub ↗
(&mut self, key: &K)

Source from the content-addressed store, hash-verified

72 }
73
74 fn get(&mut self, key: &K) -> Option<&V> {
75 if self.contains(key) { self.access(key); }
76
77 let entries = &self.entries;
78 self.map.get(key).and_then(move |&i| {
79 entries[i].val.as_ref()
80 })
81 }
82
83 fn get_mut(&mut self, key: &K) -> Option<&mut V> {
84 if self.contains(key) { self.access(key); }

Callers 5

get_mutMethod · 0.45
accessMethod · 0.45
mainFunction · 0.45
block_infoMethod · 0.45
block_infoMethod · 0.45

Calls 2

containsMethod · 0.45
accessMethod · 0.45

Tested by

no test coverage detected