Struct luther::Span
[−]
[src]
pub struct Span<T> { /* fields omitted */ }
Wraps a value with start and end Location
's.
Methods
impl<T> Span<T>
[src]
pub fn new(start: Location, end: Location, value: T) -> Span<T>
[src]
Create a new Span
for a given start and end Location
and value.
pub fn start(&self) -> Location
[src]
Gets the start Location
of the Span
.
pub fn end(&self) -> Location
[src]
Gets the end Location
of the Span
.
pub fn value_ref(&self) -> &T
[src]
Gets a reference to the value of the Span
.
pub fn extend(&mut self, end: Location)
[src]
Extends the current Span
to a new end Location
.
pub fn into_inner(self) -> (Location, T, Location)
[src]
Consumes the span, returning a (start, value, end) tuple.
This is the format expected for a lalrpop external lexer.
Trait Implementations
impl<T: Clone> Clone for Span<T>
[src]
fn clone(&self) -> Span<T>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: PartialEq> PartialEq for Span<T>
[src]
fn eq(&self, __arg_0: &Span<T>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Span<T>) -> bool
[src]
This method tests for !=
.
impl<T: Eq> Eq for Span<T>
[src]
impl<T: Debug> Debug for Span<T>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more