pub trait Ranged {
    fn range(&self) -> &Range;

    fn start(&self) -> usize { ... }
fn start_line(&self) -> usize { ... }
fn end(&self) -> usize { ... }
fn end_line(&self) -> usize { ... }
fn text<'a>(&self, text: &'a str) -> &'a str { ... }
fn start_position(&self) -> &Position { ... }
fn end_position(&self) -> &Position { ... }
fn width(&self) -> usize { ... } }
Expand description

Represents an object that has a range in the text.

Required methods

Gets the range.

Provided methods

Gets the byte index of the first character in the text.

Gets the line number of the start position in the text.

Gets the byte index after the last character in the text.

Gets the line number of the end position in the text.

Gets the text from the provided string.

Gets the start position.

Gets the end byte position.

Gets the end byte index minus the start byte index of the range.

Implementors