pub struct EntryRangeDecoder<'window, 'scratch> { /* private fields */ }Expand description
Read plain body or delta-instruction bytes from a previously authenticated
packed entry. Supply packed bytes starting at entry_offset. Inflation skips
the prefix using caller scratch, then emits only the requested inflated range.
One update performs at most one inflater step. Scratch retains pending bytes
across output backpressure; no whole entry/body/pack is retained.
Completion can precede the entry’s end. It does NOT verify the remaining compressed stream, entry CRC, pack checksum or canonical object identity. Authenticate the source and index before partial reads. For new packs first run Decoder to complete intake validation. Hosts may cache inflated pages to avoid repeated prefix inflation when serving RangeResolver requests.
Implementations§
Source§impl<'window, 'scratch> EntryRangeDecoder<'window, 'scratch>
impl<'window, 'scratch> EntryRangeDecoder<'window, 'scratch>
pub fn new( format: ObjectFormat, entry_offset: u64, window: &'window mut [u8; 32768], max_entry_bytes: u64, inflate: InflateLimits, range: ByteRange, scratch: &'scratch mut [u8], ) -> Result<Self>
pub fn wire_position(&self) -> u64
pub fn inflated_position(&self) -> u64
pub fn position(&self) -> u64
Sourcepub fn update(
&mut self,
input: &[u8],
output: &mut [u8],
end_of_input: bool,
) -> Result<EntryRangeProgress>
pub fn update( &mut self, input: &[u8], output: &mut [u8], end_of_input: bool, ) -> Result<EntryRangeProgress>
Preserve packed input not consumed and output not yet sent. Finished calls repeat without consuming following entries. Errors are terminal.