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

Function objects_by_key

atomic-cli/src/commands/sidecars.rs:136–144  ·  view source on GitHub ↗

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

(
    pack: &'a SyncPack,
    family: ObjectFamily,
)

Source from the content-addressed store, hash-verified

134
135/// Index a pack's objects of one family into `content key → bytes`.
136fn objects_by_key<'a>(
137 pack: &'a SyncPack,
138 family: ObjectFamily,
139) -> impl Iterator<Item = (String, Vec<u8>)> + 'a {
140 pack.objects
141 .iter()
142 .filter(move |o| o.family == family)
143 .map(|o| (o.key.clone(), o.bytes.clone()))
144}
145
146/// First 12 chars of a base32 key, for display.
147fn short(key: &str) -> &str {

Callers 1

import_sidecarsFunction · 0.85

Calls 2

iterMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected