Trait chumsky::error::Span[][src]

pub trait Span {
    type Position: Ord;
    fn start(&self) -> Self::Position;
fn end(&self) -> Self::Position;
fn union(self, other: Self) -> Self;
fn inner(self, other: Self) -> Self;
fn display(&self) -> Box<dyn Display>; }
Expand description

A trait representing a span over elements of a token stream

Associated Types

A position that can be used to demarcate the bounds of this span.

Required methods

Get the start position of this span.

Get the (exclusive) end position of this span.

Find the span that is the closest fit around two spans as possible.

Panics

This function is permitted to panic if the first comes after the last.

Find the span that fits between two spans but does not intersect with either.

Panics

This function is permitted to panic if the spans intersect or the first comes after the last.

Return a value that allows displaying this span.

Note that this function exists to work around certain implementation details and is highly likely to be removed in the future. If possible, implement std::fmt::Display for your span type too.

Implementations on Foreign Types

Implementors