Trait miette::SpanContents

source ·
pub trait SpanContents<'a> {
    fn data(&self) -> &'a [u8] ;
    fn span(&self) -> &SourceSpan;
    fn line(&self) -> usize;
    fn column(&self) -> usize;
    fn line_count(&self) -> usize;

    fn name(&self) -> Option<&str> { ... }
}
Expand description

Contents of a SourceCode covered by SourceSpan.

Includes line and column information to optimize highlight calculations.

Required Methods

Reference to the data inside the associated span, in bytes.

SourceSpan representing the span covered by this SpanContents.

The 0-indexed line in the associated SourceCode where the data begins.

The 0-indexed column in the associated SourceCode where the data begins, relative to line.

Total number of lines covered by this SpanContents.

Provided Methods

An optional (file?) name for the container of this SpanContents.

Implementors