[−][src]Struct syntax_pos::MultiSpan
A collection of spans. 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.
Methods
impl MultiSpan
[src]
impl MultiSpan
pub fn new() -> MultiSpan
[src]
pub fn new() -> MultiSpan
pub fn from_span(primary_span: Span) -> MultiSpan
[src]
pub fn from_span(primary_span: Span) -> MultiSpan
pub fn from_spans(vec: Vec<Span>) -> MultiSpan
[src]
pub fn from_spans(vec: Vec<Span>) -> MultiSpan
pub fn push_span_label(&mut self, span: Span, label: String)
[src]
pub fn push_span_label(&mut self, span: Span, label: String)
pub fn primary_span(&self) -> Option<Span>
[src]
pub fn primary_span(&self) -> Option<Span>
Selects the first primary span (if any)
pub fn primary_spans(&self) -> &[Span]
[src]
pub fn primary_spans(&self) -> &[Span]
Returns all primary spans.
pub fn is_dummy(&self) -> bool
[src]
pub fn is_dummy(&self) -> bool
Returns true
if this contains only a dummy primary span with any hygienic context.
pub fn replace(&mut self, before: Span, after: Span) -> bool
[src]
pub fn replace(&mut self, before: Span, after: Span) -> bool
Replaces all occurrences of one Span with another. Used to move Spans in areas that don't display well (like std macros). Returns true if replacements occurred.
pub fn span_labels(&self) -> Vec<SpanLabel>
[src]
pub fn span_labels(&self) -> Vec<SpanLabel>
Returns the strings to highlight. We always ensure that there
is an entry for each of the primary spans -- for each primary
span 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.
Trait Implementations
impl Clone for MultiSpan
[src]
impl Clone for MultiSpan
fn clone(&self) -> MultiSpan
[src]
fn clone(&self) -> MultiSpan
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl From<Span> for MultiSpan
[src]
impl From<Span> for MultiSpan
impl From<Vec<Span>> for MultiSpan
[src]
impl From<Vec<Span>> for MultiSpan
impl Eq for MultiSpan
[src]
impl Eq for MultiSpan
impl PartialEq<MultiSpan> for MultiSpan
[src]
impl PartialEq<MultiSpan> for MultiSpan
impl Debug for MultiSpan
[src]
impl Debug for MultiSpan
impl Hash for MultiSpan
[src]
impl Hash for MultiSpan
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Decodable for MultiSpan
[src]
impl Decodable for MultiSpan
impl Encodable for MultiSpan
[src]
impl Encodable for MultiSpan
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T> Decodable for T where
T: UseSpecializedDecodable,
[src]
impl<T> Decodable for T where
T: UseSpecializedDecodable,
impl<T> Encodable for T where
T: UseSpecializedEncodable + ?Sized,
[src]
impl<T> Encodable for T where
T: UseSpecializedEncodable + ?Sized,
impl<E> SpecializationError for E
[src]
impl<E> SpecializationError for E
impl<T> Erased for T
[src]
impl<T> Erased for T
impl<T> Send for T where
T: ?Sized,
[src]
impl<T> Send for T where
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
impl<T> Sync for T where
T: ?Sized,
impl<T> Erased for T
impl<T> Erased for T