Skip to main content

PartialDescriptor

Struct PartialDescriptor 

Source
pub struct PartialDescriptor { /* private fields */ }
Expand description

A descriptor opened for seek-based partial reads.

Holds the small records read up front plus the on-disk locators of every object/channel/model record. Every read goes through an internal CountingReader, so bytes_read is a real, deterministic I/O figure.

Implementations§

Source§

impl PartialDescriptor

Source

pub fn open(path: &Path, limits: Limits) -> Result<PartialLoad>

Walk the framing of the descriptor at path, reading only the small records. Returns PartialLoad::Ineligible when the descriptor cannot be served lazily (no op table or external objects): the caller must then use the full path.

Source

pub fn bytes_read(&self) -> u64

Real bytes fetched from the descriptor file by this loader.

Source

pub fn source_len(&self) -> u64

Declared source length (from the INTEGRITY record).

Source

pub fn source_sha256(&self) -> [u8; 32]

Declared whole-source SHA-256 (from the INTEGRITY record).

Source

pub fn object_count(&self) -> usize

Number of raw object records in the descriptor.

Source

pub fn graph_ops(&self) -> usize

Number of instructions in the reconstruction program.

Trait Implementations§

Source§

impl Debug for PartialDescriptor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl SourceServer for PartialDescriptor

Source§

fn serve_range(&self, offset: u64, len: u64, limits: Limits) -> Result<Vec<u8>>

Bytes of the source range [offset, offset + len).
Source§

fn serve_document(&self, _limits: Limits) -> Result<Vec<u8>>

The whole reconstructed source (only a DocumentExact node needs this).

Auto Trait Implementations§

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.