noodles_csi/binning_index/index/reference_sequence/
index.rs

1//! Binning index reference sequence index.
2
3mod binned_index;
4mod linear_index;
5
6use noodles_bgzf as bgzf;
7use noodles_core::Position;
8
9pub use self::{binned_index::BinnedIndex, linear_index::LinearIndex};
10use super::bin::Chunk;
11
12/// A binning index reference sequence index.
13pub trait Index {
14    /// Returns the start virtual position of the first record in the bin that contains the given
15    /// start position.
16    fn min_offset(&self, min_shift: u8, depth: u8, start: Position) -> bgzf::VirtualPosition;
17
18    /// Returns the start virtual position of the last first record.
19    fn last_first_start_position(&self) -> Option<bgzf::VirtualPosition>;
20
21    /// Adds a record to the index.
22    fn update(&mut self, min_shift: u8, depth: u8, start: Position, end: Position, chunk: Chunk);
23}