A collection of
Spans have two orthogonal attributes:
- They can be primary spans. In this case they are the locus of
the error, and would be rendered with
- They can have a label. In this case, the label is written next to the mark in the snippet when we render.
span_labels: Vec<(Span, String)>
pub fn from_spans(vec: Vec<Span>) -> MultiSpan[src]
pub fn push_span_label(&mut self, span: Span, label: String)[src]
pub fn primary_span(&self) -> Option<Span>[src]
Selects the first primary span (if any).
pub fn primary_spans(&self) -> &[Span][src]
Returns all primary spans.
pub fn has_primary_spans(&self) -> bool[src]
true if any of the primary spans are displayable.
true if this contains only a dummy primary span with any hygienic context.
Replaces all occurrences of one Span with another. Used to move
Spans in areas that don't
display well (like std macros). Returns whether replacements occurred.
pub fn span_labels(&self) -> Vec<SpanLabel>[src]
Returns the strings to highlight. We always ensure that there
is an entry for each of the primary spans -- for each primary
P, if there is at least one label with span
P, we return
those labels (marked as primary). But otherwise we return
SpanLabel instances with empty labels.
pub fn has_span_labels(&self) -> bool[src]
true if any of the span labels is displayable.
fn hash_slice<H>(data: &[Self], state: &mut H) where1.3.0[src]
impl StructuralEq for MultiSpan[src]
impl StructuralPartialEq for MultiSpan[src]
Auto Trait Implementations
impl RefUnwindSafe for MultiSpan
impl UnwindSafe for MultiSpan
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)[src]
type Error = Infallible
The type returned in the event of a conversion error.