pub struct Diagnostic {
pub severity: Severity,
pub message: String,
pub primary_span: Span,
pub labels: Vec<Label>,
}Expand description
Strukturierte Diagnose-Meldung.
Modelliert nach rustc-Diagnostics: ein Schweregrad, eine Hauptbotschaft, ein primary-Span und beliebig viele zusaetzliche Labels mit eigenem Text.
Fields§
§severity: SeveritySchweregrad.
message: StringKompakter Text (eine Zeile, ohne Punkt am Ende).
primary_span: SpanPrimary-Anker im Source-Text.
labels: Vec<Label>Zusaetzliche Anker mit Erlaeuterungen.
Implementations§
Source§impl Diagnostic
impl Diagnostic
Sourcepub fn error(message: impl Into<String>, primary_span: Span) -> Self
pub fn error(message: impl Into<String>, primary_span: Span) -> Self
Konstruktor fuer Fehler-Diagnostiken.
Sourcepub fn warning(message: impl Into<String>, primary_span: Span) -> Self
pub fn warning(message: impl Into<String>, primary_span: Span) -> Self
Konstruktor fuer Warnung-Diagnostiken.
Sourcepub fn with_label(self, span: Span, message: impl Into<String>) -> Self
pub fn with_label(self, span: Span, message: impl Into<String>) -> Self
Builder-Methode: zusaetzliches Label anhaengen.
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 Diagnostic
impl Debug for Diagnostic
Source§impl PartialEq for Diagnostic
impl PartialEq for Diagnostic
Source§fn eq(&self, other: &Diagnostic) -> bool
fn eq(&self, other: &Diagnostic) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for Diagnostic
impl StructuralPartialEq for Diagnostic
Auto Trait Implementations§
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnsafeUnpin for Diagnostic
impl UnwindSafe for Diagnostic
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