Struct esparse::ast::Loc [−][src]
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]
impl Loc
pub fn new(pos: usize, row: usize, col: usize) -> Self
[src]
pub fn new(pos: usize, row: usize, col: usize) -> Self
Creates a new Loc
with the given positions.
pub fn zero() -> Self
[src]
pub 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 Debug for Loc
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Loc
[src]
impl Clone for Loc
fn clone(&self) -> Loc
[src]
fn clone(&self) -> Loc
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for Loc
[src]
impl Copy for Loc
impl PartialEq for Loc
[src]
impl PartialEq for Loc
fn eq(&self, other: &Loc) -> bool
[src]
fn eq(&self, other: &Loc) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Loc) -> bool
[src]
fn ne(&self, other: &Loc) -> bool
This method tests for !=
.
impl Eq for Loc
[src]
impl Eq for Loc
impl Hash for Loc
[src]
impl Hash for Loc
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &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[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
[src]Feeds a slice of this type into the given [Hasher
]. Read more
impl Default for Loc
[src]
impl Default for Loc
impl Display for Loc
[src]
impl Display for Loc