Struct Span
pub struct Span { pub start: Position, pub end: Position }
Span represents the position information of a single AST item.
All span positions are absolute byte offsets that can be used on the original regular expression that was parsed.
Fields
start: PositionThe start byte offset.
end: PositionThe end byte offset.
Implementations
impl Span
fn new(start: Position, end: Position) -> SpanCreate a new span with the given positions.
fn splat(pos: Position) -> SpanCreate a new span using the given position as the start and end.
fn with_start(self, pos: Position) -> SpanCreate a new span by replacing the starting the position with the one given.
fn with_end(self, pos: Position) -> SpanCreate a new span by replacing the ending the position with the one given.
fn is_one_line(&self) -> boolReturns true if and only if this span occurs on a single line.
fn is_empty(&self) -> boolReturns true if and only if this span is empty. That is, it points to a single position in the concrete syntax of a regular expression.
Trait Implementations
impl Clone for Span
fn clone(&self) -> Self
impl Copy for Span
impl Debug for Span
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Span
impl Ord for Span
fn cmp(&self, other: &Span) -> Ordering
impl PartialEq for Span
fn eq(&self, other: &Self) -> bool
impl PartialOrd for Span
fn partial_cmp(&self, other: &Span) -> Option<Ordering>