Struct DiagnosticLabel
pub struct DiagnosticLabel { /* private fields */ }Expand description
Renderer-neutral context attached to a diagnostic.
Implementations§
§impl DiagnosticLabel
impl DiagnosticLabel
pub const fn new(
kind: DiagnosticLabelKind,
message: DiagnosticMessage,
span: Option<DiagnosticSpan>,
) -> DiagnosticLabel
pub const fn new( kind: DiagnosticLabelKind, message: DiagnosticMessage, span: Option<DiagnosticSpan>, ) -> DiagnosticLabel
Creates a diagnostic label.
pub const fn primary(
message: DiagnosticMessage,
span: DiagnosticSpan,
) -> DiagnosticLabel
pub const fn primary( message: DiagnosticMessage, span: DiagnosticSpan, ) -> DiagnosticLabel
Creates a primary label with a span.
pub const fn secondary(
message: DiagnosticMessage,
span: DiagnosticSpan,
) -> DiagnosticLabel
pub const fn secondary( message: DiagnosticMessage, span: DiagnosticSpan, ) -> DiagnosticLabel
Creates a secondary label with a span.
pub const fn help(message: DiagnosticMessage) -> DiagnosticLabel
pub const fn help(message: DiagnosticMessage) -> DiagnosticLabel
Creates a help label without a span.
pub const fn note(message: DiagnosticMessage) -> DiagnosticLabel
pub const fn note(message: DiagnosticMessage) -> DiagnosticLabel
Creates a note label without a span.
pub const fn kind(&self) -> DiagnosticLabelKind
pub const fn kind(&self) -> DiagnosticLabelKind
Returns the label kind.
pub const fn message(&self) -> &DiagnosticMessage
pub const fn message(&self) -> &DiagnosticMessage
Returns the label message.
pub const fn span(&self) -> Option<&DiagnosticSpan>
pub const fn span(&self) -> Option<&DiagnosticSpan>
Returns the optional label span.
Trait Implementations§
§impl Clone for DiagnosticLabel
impl Clone for DiagnosticLabel
§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 more§impl Debug for DiagnosticLabel
impl Debug for DiagnosticLabel
§impl Display for DiagnosticLabel
impl Display for DiagnosticLabel
§impl Hash for DiagnosticLabel
impl Hash for DiagnosticLabel
§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