Trait qwt::SelectQuad
source · 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 ith occurrence of
symbol.
We start counting from 1, so that select(symbol, 1) refers to the first
occurrence of symbol. select(symbol, 0) returns None.
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 ith occurrence of
symbol.
We start counting from 1, so that select(symbol, 1) 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.