pub trait Indexer {
// Required methods
fn line_col_at(&self, pos: usize) -> (usize, usize);
fn line_span_at(&self, pos: usize) -> (usize, usize);
fn span_with_context_lines(
&self,
start: usize,
end: usize,
context_lines_before: usize,
context_lines_after: usize,
) -> (usize, usize);
}Expand description
A indexable string.
Required Methods§
Sourcefn line_col_at(&self, pos: usize) -> (usize, usize)
fn line_col_at(&self, pos: usize) -> (usize, usize)
Returns the line and column number of this Position.
Sourcefn line_span_at(&self, pos: usize) -> (usize, usize)
fn line_span_at(&self, pos: usize) -> (usize, usize)
Returns the start and the end of the line that contains the position at pos.