cfgrammar::span

Trait Spanned

source
pub trait Spanned: Display {
    // Required methods
    fn spans(&self) -> &[Span];
    fn spanskind(&self) -> SpansKind;
}
Expand description

Implemented for errors and warnings to provide access to their spans.

Required Methods§

source

fn spans(&self) -> &[Span]

Returns the spans associated with the error, always containing at least 1 span.

Refer to SpansKind via spanskind for the meaning and interpretation of spans and their ordering.

source

fn spanskind(&self) -> SpansKind

Returns the SpansKind associated with this error.

Implementors§