Struct esparse::ast::Loc
[−]
[src]
pub struct Loc { pub pos: usize, pub row: usize, pub col: usize, }
A location in source code.
Stores both the bytewise position and the logical line and character numbers.
Fields
pos: usize
0-based byte index.
row: usize
0-based line number.
col: usize
0-based character number on the line.
Methods
impl Loc
[src]
fn new(pos: usize, row: usize, col: usize) -> Self
Creates a new Loc
with the given positions.
fn zero() -> Self
Creates a new Loc
pointing to the first byte of the source code (pos
, row
, and col
all zero).
Trait Implementations
impl Debug for Loc
[src]
impl Clone for Loc
[src]
fn clone(&self) -> Loc
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 Loc
[src]
impl PartialEq for Loc
[src]
fn eq(&self, __arg_0: &Loc) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Loc) -> bool
This method tests for !=
.
impl Eq for Loc
[src]
impl Hash for Loc
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more