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
char: usize
The index of this character within the body of text.
line: usize
The line number on which this character may be found.
column: usize
The column on which this character may be found.
Methods
impl SourceOffset
[src]
fn new(char: usize, line: usize, column: usize) -> SourceOffset
Construct a SourceOffset
.
Trait Implementations
impl Clone for SourceOffset
[src]
fn clone(&self) -> SourceOffset
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for SourceOffset
[src]
impl Debug for SourceOffset
[src]
impl PartialEq for SourceOffset
[src]
fn eq(&self, __arg_0: &SourceOffset) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SourceOffset) -> bool
This method tests for !=
.