Trait HasSpan

Source
pub trait HasSpan {
    // Required method
    fn span(&self) -> Span;

    // Provided method
    fn human_span(&self) -> Span { ... }
}
Expand description

Provides span information for syntax nodes.

Required Methods§

Source

fn span(&self) -> Span

Obtain the full span of the input file that this node covers.

Provided Methods§

Source

fn human_span(&self) -> Span

Obtain a span which can be used to refer to this node in error messages presented to humans. This will generally be the name for things like entities, processes, and variables. Defaults to return whatever span() returns.

Implementors§

Source§

impl<T> HasSpan for Spanned<T>