Skip to main content

read_object_header_at_with_cache

Function read_object_header_at_with_cache 

Source
pub fn read_object_header_at_with_cache<F, C>(
    pack_bytes: &[u8],
    offset: u64,
    format: ObjectFormat,
    resolve_ref_base_type: F,
    type_cache: &mut C,
) -> Result<(ObjectType, u64)>
Expand description

Like read_object_header_at but threads a caller-owned HeaderTypeCache through the read so (a) the ofs-delta chain’s end-of-chain type is resolved at most once per chain and (b) a repeated lookup of the same offset returns from the memo without re-inflating (sley#26). The cache is keyed by in-pack offset, so it must be scoped to a single pack’s bytes by the caller.