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>
impl<'frames> RangeResolver<'frames>
pub fn new( format: ObjectFormat, key: ObjectKey, range: ObjectRange, frames: &'frames mut [RangeFrame], limits: RangeLimits, ) -> Result<RangeResolver<'frames>, Error>
pub fn position(&self) -> u64
pub fn work_bytes(&self) -> u64
Sourcepub fn request(&mut self) -> Result<RangeRequest, Error>
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.
pub fn describe(&mut self, object: RangeObject) -> Result<(), Error>
Sourcepub fn update(
&mut self,
input: &[u8],
output: &mut [u8],
) -> Result<RangeProgress, Error>
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.