Struct esparse::ast::Span
[−]
[src]
pub struct Span<'f> { pub file_name: &'f str, pub start: Loc, pub end: Loc, }
A region of source code.
A pair of locations, representing a half-open range, and a file name, identifying the source code in which this region appears.
Fields
file_name: &'f str
The name of the source code.
Often a file name, but can be an arbitrary string like <input>
.
start: Loc
The (inclusive) starting location.
end: Loc
The (exclusive) ending location.
Methods
impl<'f> Span<'f>
[src]
fn new(file_name: &'f str, start: Loc, end: Loc) -> Self
Creates a new Span
with the given file name and locations.
fn empty(file_name: &'f str, loc: Loc) -> Self
Creates an empty Span
at the given location, with the given file name.
fn zero(file_name: &'f str) -> Self
Creates an empty Span
with the given file name, pointing to the first position in the file.
Trait Implementations
impl<'f> Debug for Span<'f>
[src]
impl<'f> Clone for Span<'f>
[src]
fn clone(&self) -> Span<'f>
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<'f> Copy for Span<'f>
[src]
impl<'f> PartialEq for Span<'f>
[src]
fn eq(&self, __arg_0: &Span<'f>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Span<'f>) -> bool
This method tests for !=
.