pub struct DiagnosticLabel { /* private fields */ }Expand description
Renderer-neutral context attached to a diagnostic.
Implementations§
Source§impl DiagnosticLabel
impl DiagnosticLabel
Sourcepub const fn new(
kind: DiagnosticLabelKind,
message: DiagnosticMessage,
span: Option<DiagnosticSpan>,
) -> Self
pub const fn new( kind: DiagnosticLabelKind, message: DiagnosticMessage, span: Option<DiagnosticSpan>, ) -> Self
Creates a diagnostic label.
Sourcepub const fn primary(message: DiagnosticMessage, span: DiagnosticSpan) -> Self
pub const fn primary(message: DiagnosticMessage, span: DiagnosticSpan) -> Self
Creates a primary label with a span.
Sourcepub const fn secondary(message: DiagnosticMessage, span: DiagnosticSpan) -> Self
pub const fn secondary(message: DiagnosticMessage, span: DiagnosticSpan) -> Self
Creates a secondary label with a span.
Sourcepub const fn help(message: DiagnosticMessage) -> Self
pub const fn help(message: DiagnosticMessage) -> Self
Creates a help label without a span.
Sourcepub const fn note(message: DiagnosticMessage) -> Self
pub const fn note(message: DiagnosticMessage) -> Self
Creates a note label without a span.
Sourcepub const fn kind(&self) -> DiagnosticLabelKind
pub const fn kind(&self) -> DiagnosticLabelKind
Returns the label kind.
Sourcepub const fn message(&self) -> &DiagnosticMessage
pub const fn message(&self) -> &DiagnosticMessage
Returns the label message.
Sourcepub const fn span(&self) -> Option<&DiagnosticSpan>
pub const fn span(&self) -> Option<&DiagnosticSpan>
Returns the optional label span.
Trait Implementations§
Source§impl Clone for DiagnosticLabel
impl Clone for DiagnosticLabel
Source§fn clone(&self) -> DiagnosticLabel
fn clone(&self) -> DiagnosticLabel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DiagnosticLabel
impl Debug for DiagnosticLabel
Source§impl Display for DiagnosticLabel
impl Display for DiagnosticLabel
Source§impl Hash for DiagnosticLabel
impl Hash for DiagnosticLabel
Source§impl PartialEq for DiagnosticLabel
impl PartialEq for DiagnosticLabel
impl Eq for DiagnosticLabel
impl StructuralPartialEq for DiagnosticLabel
Auto Trait Implementations§
impl Freeze for DiagnosticLabel
impl RefUnwindSafe for DiagnosticLabel
impl Send for DiagnosticLabel
impl Sync for DiagnosticLabel
impl Unpin for DiagnosticLabel
impl UnsafeUnpin for DiagnosticLabel
impl UnwindSafe for DiagnosticLabel
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