Struct Span

struct Span { ... }

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: Position

The start byte offset.

end: Position

The end byte offset.

Implementations

impl Span

fn new(start: Position, end: Position) -> Span

Create a new span with the given positions.

fn splat(pos: Position) -> Span

Create a new span using the given position as the start and end.

fn with_start(self: Self, pos: Position) -> Span

Create a new span by replacing the starting the position with the one given.

fn with_end(self: Self, pos: Position) -> Span

Create a new span by replacing the ending the position with the one given.

fn is_one_line(self: &Self) -> bool

Returns true if and only if this span occurs on a single line.

fn is_empty(self: &Self) -> bool

Returns 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.

impl Clone for Span

fn clone(self: &Self) -> Span

impl Copy for Span

impl Debug for Span

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl Eq for Span

impl Freeze for Span

impl Ord for Span

fn cmp(self: &Self, other: &Span) -> Ordering

impl PartialEq for Span

fn eq(self: &Self, other: &Span) -> bool

impl PartialOrd for Span

fn partial_cmp(self: &Self, other: &Span) -> Option<Ordering>

impl RefUnwindSafe for Span

impl Send for Span

impl StructuralPartialEq for Span

impl Sync for Span

impl Unpin for Span

impl UnsafeUnpin for Span

impl UnwindSafe for Span

impl<T> Any for Span

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Span

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Span

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Span

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Span

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Span

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Span

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Span

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Span

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>