pub struct BlockIndexReader<'a> { /* private fields */ }Expand description
Block index reader for loading block index entries on-demand
Implementations§
Source§impl<'a> BlockIndexReader<'a>
impl<'a> BlockIndexReader<'a>
Sourcepub fn new(data: &'a [u8]) -> Self
pub fn new(data: &'a [u8]) -> Self
Create a new block index reader from the block index section
Sourcepub fn read_entry(&self, offset: usize) -> Result<BlockIndexEntry>
pub fn read_entry(&self, offset: usize) -> Result<BlockIndexEntry>
Read a single block index entry at the given offset
Sourcepub fn read_range(
&self,
start: usize,
end: usize,
) -> Result<Vec<BlockIndexEntry>>
pub fn read_range( &self, start: usize, end: usize, ) -> Result<Vec<BlockIndexEntry>>
Read a range of block index entries
Sourcepub fn find_block_for_key(
&self,
key: &TemporalKey,
start_offset: usize,
end_offset: usize,
) -> Result<Option<BlockIndexEntry>>
pub fn find_block_for_key( &self, key: &TemporalKey, start_offset: usize, end_offset: usize, ) -> Result<Option<BlockIndexEntry>>
Binary search for a key in a range of block index entries
Sourcepub fn find_blocks_for_range(
&self,
start_ts: u64,
end_ts: u64,
start_offset: usize,
end_offset: usize,
) -> Result<Vec<BlockIndexEntry>>
pub fn find_blocks_for_range( &self, start_ts: u64, end_ts: u64, start_offset: usize, end_offset: usize, ) -> Result<Vec<BlockIndexEntry>>
Find all blocks that overlap with a timestamp range
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Get total number of entries in this reader’s range
Auto Trait Implementations§
impl<'a> Freeze for BlockIndexReader<'a>
impl<'a> RefUnwindSafe for BlockIndexReader<'a>
impl<'a> Send for BlockIndexReader<'a>
impl<'a> Sync for BlockIndexReader<'a>
impl<'a> Unpin for BlockIndexReader<'a>
impl<'a> UnsafeUnpin for BlockIndexReader<'a>
impl<'a> UnwindSafe for BlockIndexReader<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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