[][src]Trait jsonc_parser::common::Ranged

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

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

Represents an object that has a range in the text.

Required methods

pub fn range(&self) -> &Range[src]

Gets the range.

Loading content...

Provided methods

pub fn start(&self) -> usize[src]

Gets the index of the first character in the text.

pub fn start_line(&self) -> usize[src]

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

pub fn end(&self) -> usize[src]

Gets the index after the last character in the text.

pub fn end_line(&self) -> usize[src]

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

pub fn text<'a>(&self, text: &'a str) -> &'a str[src]

Gets the text from the provided string.

pub fn start_position(&self) -> Position[src]

Gets the start position.

pub fn end_position(&self) -> Position[src]

Gets the end position.

pub fn width(&self) -> usize[src]

Gets the end position minus the start of the range.

Loading content...

Implementors

impl Ranged for Comment[src]

impl Ranged for ObjectPropName[src]

impl Ranged for Value[src]

impl Ranged for Array[src]

impl Ranged for BooleanLit[src]

impl Ranged for CommentBlock[src]

impl Ranged for CommentLine[src]

impl Ranged for NullKeyword[src]

impl Ranged for NumberLit[src]

impl Ranged for Object[src]

impl Ranged for ObjectProp[src]

impl Ranged for StringLit[src]

impl Ranged for WordLit[src]

impl Ranged for Position[src]

impl Ranged for TokenAndRange[src]

impl<'a> Ranged for Node<'a>[src]

Loading content...