pub struct Entry<'a> { /* private fields */ }Expand description
One checksummed/inflated entry. Delta data is an instruction stream rather than a Git object body; resolve it against an authenticated materialized base.
Implementations§
Source§impl<'a> Entry<'a>
impl<'a> Entry<'a>
pub fn offset(&self) -> u64
pub fn end_offset(&self) -> u64
Sourcepub fn compressed_offset(&self) -> u64
pub fn compressed_offset(&self) -> u64
First byte of the zlib stream, after type/size and delta-base metadata.
pub fn crc32(&self) -> u32
pub fn kind(&self) -> EntryKind
pub fn data(&self) -> &'a [u8]
Sourcepub fn verify_crc32(&self, expected: u32) -> Result<(), Error>
pub fn verify_crc32(&self, expected: u32) -> Result<(), Error>
Compare the entry’s wire CRC with a trusted pack-index CRC. Packs do not carry per-entry CRCs themselves; the complete pack hash is also checked.
Sourcepub fn object(&self) -> Option<ResolvedObject<'a>>
pub fn object(&self) -> Option<ResolvedObject<'a>>
Materialize metadata/ID for a non-delta entry without copying its body.
Sourcepub fn resolve_delta<'out>(
&self,
base: &ResolvedObject<'_>,
output: &'out mut [u8],
limits: DeltaLimits,
) -> Result<ResolvedObject<'out>, Error>
pub fn resolve_delta<'out>( &self, base: &ResolvedObject<'_>, output: &'out mut [u8], limits: DeltaLimits, ) -> Result<ResolvedObject<'out>, Error>
Resolve one delta using a previously resolved entry or an external base. Offset bases must come from this pack at exactly the advertised offset; reference bases must have exactly the advertised canonical object ID. Depth is carried by resolved values, and output/instruction/depth budgets are checked before returning an object. Discard staging output on error.