Skip to main content

RangeResolver

Struct RangeResolver 

Source
pub struct RangeResolver<'frames> { /* private fields */ }
Expand description

Reconstruct a canonical object or range without retaining a base/result or a repository-sized index. Supply metadata and representation reads requested by request; every read is resumable across storage awaits and output limits. Input is never retained, including when a copy descends into another delta. Unconsumed bytes can be resubmitted or refetched at the next requested offset.

Metadata/read replies must come from one immutable, authenticated snapshot. Bases must already have verified canonical IDs, kinds, sizes and delta depth. For a new staged root, request All, execute every read, hash emitted bytes with ObjectDigest, and verify the pack and graph before publication. Partial reads of existing objects can stop before the end of trusted instructions. The host authenticates underlying storage; this API does not hash replies. Caching inflated instruction pages and canonical base ranges avoids repeated decompression. Frames and all budgets are supplied by the caller.

Implementations§

Source§

impl<'frames> RangeResolver<'frames>

Source

pub fn new( format: ObjectFormat, key: ObjectKey, range: ObjectRange, frames: &'frames mut [RangeFrame], limits: RangeLimits, ) -> Result<RangeResolver<'frames>, Error>

Source

pub fn position(&self) -> u64

Source

pub fn work_bytes(&self) -> u64

Source

pub fn request(&mut self) -> Result<RangeRequest, Error>

A repeated request remains valid until its reply. Backend failures can be retried without advancing. Malformed replies/budget errors are terminal.

Source

pub fn describe(&mut self, object: RangeObject) -> Result<(), Error>

Source

pub fn update( &mut self, input: &[u8], output: &mut [u8], ) -> Result<RangeProgress, Error>

Supply bytes for the current read. At most the requested range and output capacity are consumed; preserve the suffix. Empty output returns NeedOutput without advancing. Empty input for a nonempty read is corrupt.

Source

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

Auto Trait Implementations§

§

impl<'frames> !UnwindSafe for RangeResolver<'frames>

§

impl<'frames> Freeze for RangeResolver<'frames>

§

impl<'frames> RefUnwindSafe for RangeResolver<'frames>

§

impl<'frames> Send for RangeResolver<'frames>

§

impl<'frames> Sync for RangeResolver<'frames>

§

impl<'frames> Unpin for RangeResolver<'frames>

§

impl<'frames> UnsafeUnpin for RangeResolver<'frames>

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.