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:104–110  ·  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

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

Callers 1

run_asyncMethod · 0.85

Calls 3

collectMethod · 0.45
iterMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected