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

Method inventory

libatomic/examples/replication_acceptance/peer.rs:93–100  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

91 .contains_key(&(family.as_str().into(), key.into()))
92 }
93 pub fn inventory(&self) -> Value {
94 let store = self.store.lock().unwrap();
95 let mut counts = BTreeMap::<String, usize>::new();
96 for (family, _) in store.objects.keys() {
97 *counts.entry(family.clone()).or_default() += 1;
98 }
99 json!({"family_counts":counts,"refs":store.refs,"post_batches":store.posts})
100 }
101}
102impl Drop for Peer {
103 fn drop(&mut self) {

Callers 1

runFunction · 0.80

Calls 3

lockMethod · 0.80
unwrapMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected