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
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".