pub struct SourceDiagnostic {
pub level: DiagnosticLevel,
pub file_path: FilePath,
pub message: SharedString,
pub excerpts: Vec<SourceExcerpt>,
}Expand description
Structured source diagnostic with excerpts and inline annotations.
Fields§
§level: DiagnosticLevelSeverity level of the diagnostic.
file_path: FilePathPrimary file associated with the diagnostic.
message: SharedStringUser-facing summary message.
excerpts: Vec<SourceExcerpt>Relevant excerpts that help explain the diagnostic.
Implementations§
Source§impl SourceDiagnostic
impl SourceDiagnostic
Sourcepub fn new(
level: DiagnosticLevel,
file_path: impl Into<FilePath>,
message: impl Into<SharedString>,
) -> Self
pub fn new( level: DiagnosticLevel, file_path: impl Into<FilePath>, message: impl Into<SharedString>, ) -> Self
Creates a source diagnostic from its level, file path, and message.
Sourcepub fn with_excerpt(self, excerpt: SourceExcerpt) -> Self
pub fn with_excerpt(self, excerpt: SourceExcerpt) -> Self
Returns a copy of this diagnostic with one appended excerpt.
Trait Implementations§
Source§impl Clone for SourceDiagnostic
impl Clone for SourceDiagnostic
Source§fn clone(&self) -> SourceDiagnostic
fn clone(&self) -> SourceDiagnostic
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 SourceDiagnostic
impl Debug for SourceDiagnostic
Source§impl PartialEq for SourceDiagnostic
impl PartialEq for SourceDiagnostic
impl Eq for SourceDiagnostic
impl StructuralPartialEq for SourceDiagnostic
Auto Trait Implementations§
impl Freeze for SourceDiagnostic
impl RefUnwindSafe for SourceDiagnostic
impl Send for SourceDiagnostic
impl Sync for SourceDiagnostic
impl Unpin for SourceDiagnostic
impl UnsafeUnpin for SourceDiagnostic
impl UnwindSafe for SourceDiagnostic
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