pub trait Span: Clone {
type Uri: PartialEq + Clone + Display;
type Source: AsRef<str> + Clone;
type Index: Indexer;
// Required methods
fn start(&self) -> usize;
fn end(&self) -> usize;
fn source_text(&self) -> &Self::Source;
fn source_index(&self) -> &Self::Index;
fn uri(&self) -> &Self::Uri;
// Provided method
fn range(&self) -> Range<usize> { ... }
}Expand description
Trait for span types used in error enums.
Required Associated Types§
Required Methods§
Sourcefn source_text(&self) -> &Self::Source
fn source_text(&self) -> &Self::Source
Get the source text of the span.
Sourcefn source_index(&self) -> &Self::Index
fn source_index(&self) -> &Self::Index
Get the index of the source.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.