pub trait SelectQuad {
// Required methods
fn select(&self, symbol: u8, i: usize) -> Option<usize>;
unsafe fn select_unchecked(&self, symbol: u8, i: usize) -> usize;
}Expand description
A trait for the support of select query over the alphabet [0..3].
Required Methods§
Sourcefn select(&self, symbol: u8, i: usize) -> Option<usize>
fn select(&self, symbol: u8, i: usize) -> Option<usize>
Returns the position in the indexed sequence of the i+1th occurrence of symbol
(0-indexed, mening the first occurrence is obtained using i = 0).
Sourceunsafe fn select_unchecked(&self, symbol: u8, i: usize) -> usize
unsafe fn select_unchecked(&self, symbol: u8, i: usize) -> usize
Returns the position in the indexed sequence of the i+1th occurrence of symbol.
We start counting from 0, so that select(symbol, 0) refers to the first
occurrence of symbol.
§Safety
Calling this method if the ith occurrence of symbol does not exist or with a symbol larger than 3 is undefined behavior.