pub struct Label<Span: ReportingSpan> {
pub span: Span,
pub message: Option<String>,
pub style: LabelStyle,
}
Expand description
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.
Implementations§
Source§impl<Span: ReportingSpan> Label<Span>
impl<Span: ReportingSpan> Label<Span>
pub fn new(span: Span, style: LabelStyle) -> Label<Span>
pub fn new_primary(span: Span) -> Label<Span>
pub fn new_secondary(span: Span) -> Label<Span>
pub fn with_message<S: Into<String>>(self, message: S) -> Label<Span>
pub fn message(&self) -> &Option<String>
Trait Implementations§
Source§impl<'de, Span> Deserialize<'de> for Label<Span>where
Span: Deserialize<'de> + ReportingSpan,
impl<'de, Span> Deserialize<'de> for Label<Span>where
Span: Deserialize<'de> + ReportingSpan,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<Span> Freeze for Label<Span>where
Span: Freeze,
impl<Span> RefUnwindSafe for Label<Span>where
Span: RefUnwindSafe,
impl<Span> Send for Label<Span>where
Span: Send,
impl<Span> Sync for Label<Span>where
Span: Sync,
impl<Span> Unpin for Label<Span>where
Span: Unpin,
impl<Span> UnwindSafe for Label<Span>where
Span: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)