pub struct IndexReader {
pub seq_base: u64,
/* private fields */
}Expand description
Reads index entries from a .idx sidecar file.
Fields§
§seq_base: u64Implementations§
Source§impl IndexReader
impl IndexReader
Sourcepub fn open(path: &Path) -> Result<Option<Self>>
pub fn open(path: &Path) -> Result<Option<Self>>
Open an existing index file. Returns Ok(None) if the file is too
small, has wrong magic, or wrong version.
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Number of lines indexed in this file.
Sourcepub fn read_record(&mut self, line: usize) -> Result<IndexRecord>
pub fn read_record(&mut self, line: usize) -> Result<IndexRecord>
Read a single record by 0-based line number.
Sourcepub fn read_range(
&mut self,
start: usize,
count: usize,
) -> Result<Vec<IndexRecord>>
pub fn read_range( &mut self, start: usize, count: usize, ) -> Result<Vec<IndexRecord>>
Read records [start..start+count), clamped to available lines.
Sourcepub fn line_count_from_metadata(path: &Path) -> Result<usize>
pub fn line_count_from_metadata(path: &Path) -> Result<usize>
Compute line count from file metadata without reading content.
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§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more