pub struct IndexReader { /* private fields */ }Expand description
High-level Index.db file reader
Implementations§
Source§impl IndexReader
impl IndexReader
Sourcepub async fn open(path: &Path, platform: Arc<Platform>) -> Result<Self>
pub async fn open(path: &Path, platform: Arc<Platform>) -> Result<Self>
Open and parse an Index.db file
Sourcepub async fn open_with_summary(
path: &Path,
platform: Arc<Platform>,
summary_reader: Option<&SummaryReader>,
) -> Result<Self>
pub async fn open_with_summary( path: &Path, platform: Arc<Platform>, summary_reader: Option<&SummaryReader>, ) -> Result<Self>
Open and parse an Index.db file with Summary.db correlation for proper offset mapping
Sourcepub fn get_partition_entries(&self) -> &[PartitionIndexEntry]
pub fn get_partition_entries(&self) -> &[PartitionIndexEntry]
Get all partition entries
Sourcepub fn lookup_partition(
&self,
key_digest: &[u8],
) -> Option<&PartitionIndexEntry>
pub fn lookup_partition( &self, key_digest: &[u8], ) -> Option<&PartitionIndexEntry>
Look up a partition by key digest
§Zero-Allocation Optimization (Issue #107)
This method performs HashMap lookup without heap allocation by leveraging
the Borrow trait. Since Arc<[u8]> implements Borrow<[u8]>, we can
lookup using &[u8] directly without creating a temporary Arc.
Before: let key_arc: Arc<[u8]> = key_digest.into(); (heap allocation per query)
After: Direct get(key_digest) using Borrow trait (zero allocations)
Sourcepub fn get_statistics(&self) -> IndexStatistics
pub fn get_statistics(&self) -> IndexStatistics
Get statistics about the index
Sourcepub async fn validate_integrity(&self) -> Result<Vec<String>>
pub async fn validate_integrity(&self) -> Result<Vec<String>>
Validate index integrity against Data.db offsets
Auto Trait Implementations§
impl Freeze for IndexReader
impl RefUnwindSafe for IndexReader
impl Send for IndexReader
impl Sync for IndexReader
impl Unpin for IndexReader
impl UnsafeUnpin for IndexReader
impl UnwindSafe for IndexReader
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more