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

char

The index of this character within the body of text.

line

The line number on which this character may be found.

column

The column on which this character may be found.

Methods

impl SourceOffset

fn new(char: usize, line: usize, column: usize) -> SourceOffset

Construct a SourceOffset.

Trait Implementations

Derived Implementations

impl PartialEq for SourceOffset

fn eq(&self, __arg_0: &SourceOffset) -> bool

fn ne(&self, __arg_0: &SourceOffset) -> bool

impl Debug for SourceOffset

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Copy for SourceOffset

impl Clone for SourceOffset

fn clone(&self) -> SourceOffset

1.0.0fn clone_from(&mut self, source: &Self)