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

Function pack_objects_by_key

atomic-cli/src/commands/pull/command.rs:101–107  ·  view source on GitHub ↗

Index a pack's objects of one family into `content key → bytes`.

(pack: &SyncPack, family: ObjectFamily)

Source from the content-addressed store, hash-verified

99
100/// Index a pack's objects of one family into `content key → bytes`.
101fn pack_objects_by_key(pack: &SyncPack, family: ObjectFamily) -> HashMap<String, Vec<u8>> {
102 pack.objects
103 .iter()
104 .filter(|o| o.family == family)
105 .map(|o| (o.key.clone(), o.bytes.clone()))
106 .collect()
107}
108
109/// Reconstruct the requested view's metadata chain from a sync pack in
110/// root-to-leaf order. The server includes the requested ref and every ancestor

Callers 1

run_asyncMethod · 0.85

Calls 2

iterMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected