Skip to main content

SpanProvider

Trait SpanProvider 

Source
pub(crate) trait SpanProvider {
    // Required method
    fn span(&self, offset: usize) -> RawUriSpan;
}
Expand description

A trait for calculating a RawUriSpan at a given byte offset in the document.

If you have a document and want spans with absolute positions, use SourceSpanProvider. If you start inside a document at a given offset, use OffsetSpanProvider.

Required Methods§

Source

fn span(&self, offset: usize) -> RawUriSpan

Compute the RawUriSpan at a given byte offset in the document.

Implementors§