Skip to main content

EntryRangeDecoder

Struct EntryRangeDecoder 

Source
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>

Source

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>

Source

pub fn wire_position(&self) -> u64

Source

pub fn inflated_position(&self) -> u64

Source

pub fn position(&self) -> u64

Source

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.

Source

pub fn finish(&self) -> Result<()>

Auto Trait Implementations§

§

impl<'window, 'scratch> !UnwindSafe for EntryRangeDecoder<'window, 'scratch>

§

impl<'window, 'scratch> Freeze for EntryRangeDecoder<'window, 'scratch>

§

impl<'window, 'scratch> RefUnwindSafe for EntryRangeDecoder<'window, 'scratch>

§

impl<'window, 'scratch> Send for EntryRangeDecoder<'window, 'scratch>

§

impl<'window, 'scratch> Sync for EntryRangeDecoder<'window, 'scratch>

§

impl<'window, 'scratch> Unpin for EntryRangeDecoder<'window, 'scratch>

§

impl<'window, 'scratch> UnsafeUnpin for EntryRangeDecoder<'window, 'scratch>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.