seek_to_offset

Function seek_to_offset 

Source
pub fn seek_to_offset<R: Read + Seek>(
    segment: &mut R,
    index_file: &TxOffsetIndex,
    start_tx_offset: u64,
) -> Result<u64, IndexError>
Expand description

Advances the segment reader to the position corresponding to the start_tx_offset using the index_file for efficient seeking.

Input:

  • segment - segment reader
  • min_tx_offset - minimum transaction offset in the segment
  • start_tx_offset - transaction offset to advance to

Returns the byte position segment is at after seeking.