Struct commands::tokenizer::SourceOffset [] [src]

pub struct SourceOffset {
    pub char: usize,
    pub line: usize,
    pub column: usize,
}

A position within a body of text.

The SourceOffset tracks 2 different ways of locating the position:

  • The index of the character within the body of text.
  • The column and line number of the character.

The SourceOffset is typically used as a pair of offsets indicating the start and end of a range of text as used by the SourceLocation.

Fields

The index of this character within the body of text.

The line number on which this character may be found.

The column on which this character may be found.

Methods

impl SourceOffset
[src]

Construct a SourceOffset.

Trait Implementations

impl Clone for SourceOffset
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for SourceOffset
[src]

impl Debug for SourceOffset
[src]

Formats the value using the given formatter.

impl PartialEq for SourceOffset
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.