pub trait Ranged {
    // Required method
    fn range(&self) -> Range;
    // Provided methods
    fn start(&self) -> usize { ... }
    fn end(&self) -> usize { ... }
    fn text<'a>(&self, text: &'a str) -> &'a str { ... }
    fn width(&self) -> usize { ... }
}Expand description
Represents an object that has a range in the text.