pub trait InputTextIndex {
// Required methods
fn cat_of_range(&self, range: Range<usize>) -> CategoryType;
fn cat_at_char(&self, offset: usize) -> CategoryType;
fn cat_continuous_len(&self, offset: usize) -> usize;
fn char_distance(&self, index: usize, offset: usize) -> usize;
fn orig_slice(&self, range: Range<usize>) -> &str;
fn curr_slice(&self, range: Range<usize>) -> &str;
fn to_orig(&self, range: Range<usize>) -> Range<usize>;
}
Expand description
Provides fast indexed access into the input text
Required Methods§
sourcefn cat_of_range(&self, range: Range<usize>) -> CategoryType
fn cat_of_range(&self, range: Range<usize>) -> CategoryType
Common character category inside the range. Indexed by chars.
sourcefn cat_at_char(&self, offset: usize) -> CategoryType
fn cat_at_char(&self, offset: usize) -> CategoryType
Character category at char offset
sourcefn cat_continuous_len(&self, offset: usize) -> usize
fn cat_continuous_len(&self, offset: usize) -> usize
Number of chars to the right of the offset with the same character category
Java name: getCharCategoryContinuousLength
sourcefn char_distance(&self, index: usize, offset: usize) -> usize
fn char_distance(&self, index: usize, offset: usize) -> usize
Distance in chars between the char indexed by index
and the char, relative to it by offset
.
Java name: getCodePointsOffsetLength
sourcefn orig_slice(&self, range: Range<usize>) -> &str
fn orig_slice(&self, range: Range<usize>) -> &str
Returns substring of original text by indices from the current text
sourcefn curr_slice(&self, range: Range<usize>) -> &str
fn curr_slice(&self, range: Range<usize>) -> &str
Returns substring of the current (modified) text by indices from the current text