MCPcopy Create free account
hub / github.com/cosdata/cosdata / get_keys

Method get_keys

src/models/lru_cache.rs:70–82  ·  view source on GitHub ↗
(&self, max: u8)

Source from the content-addressed store, hash-verified

68 }
69
70 fn get_keys(&self, max: u8) -> Vec<(u8, u64)> {
71 let mut result = vec![];
72 for (i, x) in self.inner.iter().enumerate() {
73 if result.len() > max as usize {
74 break;
75 }
76 let key = x.load(Ordering::SeqCst);
77 if key < u64::MAX {
78 result.push((i as u8, key));
79 }
80 }
81 result
82 }
83
84 fn remove(&self, idx: u8) {
85 self.clear(idx as usize)

Callers

nothing calls this directly

Calls 4

loadMethod · 0.80
iterMethod · 0.45
lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected