[][src]Struct language_reporting::Label

pub struct Label<Span: ReportingSpan> {
    pub span: Span,
    pub message: Option<String>,
    pub style: LabelStyle,
}

A label describing an underlined region of code associated with a diagnostic

Fields

span: Span

The span we are going to include in the final snippet.

message: Option<String>

A message to provide some additional information for the underlined code.

style: LabelStyle

The style to use for the label.

Methods

impl<Span: ReportingSpan> Label<Span>
[src]

pub fn new(span: Span, style: LabelStyle) -> Label<Span>
[src]

pub fn new_primary(span: Span) -> Label<Span>
[src]

pub fn new_secondary(span: Span) -> Label<Span>
[src]

pub fn with_message<S: Into<String>>(self, message: S) -> Label<Span>
[src]

pub fn message(&self) -> &Option<String>
[src]

Trait Implementations

impl<Span: Clone + ReportingSpan> Clone for Label<Span>
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<Span: Debug + ReportingSpan> Debug for Label<Span>
[src]

Auto Trait Implementations

impl<Span> Send for Label<Span> where
    Span: Send

impl<Span> Sync for Label<Span> where
    Span: Sync

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]