Struct sway_error::diagnostic::Diagnostic
source · pub struct Diagnostic { /* private fields */ }
Expand description
Provides detailed, rich description of a compile error or warning.
Implementations§
source§impl Diagnostic
impl Diagnostic
sourcepub fn is_old_style(&self) -> bool
pub fn is_old_style(&self) -> bool
For backward compatibility purposes. True if the diagnostic was defined before the detailed diagnostics were introduced. An old-style diagnostic contains just the issue.
pub fn level(&self) -> Level
pub fn reason(&self) -> Option<&Reason>
pub fn issue(&self) -> &Issue
sourcepub fn labels_in_source(&self, source_path: &SourcePath) -> Vec<&Label>
pub fn labels_in_source(&self, source_path: &SourcePath) -> Vec<&Label>
All the labels in the source file found at source_path
.
pub fn labels_in_issue_source(&self) -> Vec<&Label>
pub fn help(&self) -> impl Iterator<Item = &String> + '_
All the source files that are related to the diagnostic. This means the source file of the issue itself as well as source files of all the hints.
Trait Implementations§
source§impl Debug for Diagnostic
impl Debug for Diagnostic
source§impl Default for Diagnostic
impl Default for Diagnostic
source§fn default() -> Diagnostic
fn default() -> Diagnostic
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin 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