pub trait HasSpan {
// Required method
fn span(&self) -> Span;
// Provided methods
fn start_position(&self) -> Position { ... }
fn start_offset(&self) -> u32 { ... }
fn end_position(&self) -> Position { ... }
fn end_offset(&self) -> u32 { ... }
}Expand description
A trait for types that cover a span of source code.
Required Methods§
Provided Methods§
Sourcefn start_position(&self) -> Position
fn start_position(&self) -> Position
A convenience method to get the starting position of the span.
Sourcefn start_offset(&self) -> u32
fn start_offset(&self) -> u32
A convenience method to get the starting byte offset of the span.
Sourcefn end_position(&self) -> Position
fn end_position(&self) -> Position
A convenience method to get the ending position of the span.
Sourcefn end_offset(&self) -> u32
fn end_offset(&self) -> u32
A convenience method to get the ending byte offset of the span.