Struct passerine::common::span::Span [−][src]
Expand description
A Span
refers to a section of a source,
much like a &str
, but with a reference to a Source
rather than a String
.
A Span
is meant to be paired with other datastructures,
to be used during error reporting.
Fields
source: Option<Rc<Source>>
offset: usize
length: usize
Implementations
Create a new Span
from an offset with a length.
All Span
s have access to the Source
from whence they came,
So they can’t be misinterpreted or miscombined.
A Span
that points at a specific point in the source.
Create a new empty Span
.
An empty Span
has only a source,
if combined with another Span
, the resulting Span
will just be the other.
Compares two Spans. Returns true if this span starts the latest or is the longest in the case of a tie but false there is a total tie or otherwise.
Creates a new Span
which spans the space of the previous two.
hello this is cool
^^^^^ | Span a
^^ | Span b
^^^^^^^^^^^^^ | combined
Combines a set of Span
s (think fold-left over Span::combine
).
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Span
impl UnwindSafe for Span
Blanket Implementations
Mutably borrows from an owned value. Read more