jsonc_parser::common

Trait Ranged

Source
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.

Required Methods§

Source

fn range(&self) -> Range

Gets the range.

Provided Methods§

Source

fn start(&self) -> usize

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

Source

fn end(&self) -> usize

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

Source

fn text<'a>(&self, text: &'a str) -> &'a str

Gets the text from the provided string.

Source

fn width(&self) -> usize

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

Implementors§

Source§

impl Ranged for BooleanLit

Source§

impl Ranged for NullKeyword

Source§

impl Ranged for Range

Source§

impl<'a> Ranged for Comment<'a>

Source§

impl<'a> Ranged for ObjectPropName<'a>

Source§

impl<'a> Ranged for Value<'a>

Source§

impl<'a> Ranged for Array<'a>

Source§

impl<'a> Ranged for CommentBlock<'a>

Source§

impl<'a> Ranged for CommentLine<'a>

Source§

impl<'a> Ranged for NumberLit<'a>

Source§

impl<'a> Ranged for Object<'a>

Source§

impl<'a> Ranged for ObjectProp<'a>

Source§

impl<'a> Ranged for StringLit<'a>

Source§

impl<'a> Ranged for WordLit<'a>

Source§

impl<'a> Ranged for TokenAndRange<'a>

Source§

impl<'a, 'b> Ranged for Node<'a, 'b>