Struct biome_diagnostics::error::Error
source · pub struct Error { /* private fields */ }Expand description
The Error struct wraps any type implementing Diagnostic into a single
dynamic type.
Implementations§
source§impl Error
impl Error
Implement the Diagnostic trait as inherent methods on the Error type.
sourcepub fn category(&self) -> Option<&'static Category>
pub fn category(&self) -> Option<&'static Category>
Calls Diagnostic::category on the Diagnostic wrapped by this Error.
sourcepub fn severity(&self) -> Severity
pub fn severity(&self) -> Severity
Calls Diagnostic::severity on the Diagnostic wrapped by this Error.
sourcepub fn description(&self, fmt: &mut Formatter<'_>) -> Result
pub fn description(&self, fmt: &mut Formatter<'_>) -> Result
Calls Diagnostic::description on the Diagnostic wrapped by this Error.
sourcepub fn message(&self, fmt: &mut Formatter<'_>) -> Result<()>
pub fn message(&self, fmt: &mut Formatter<'_>) -> Result<()>
Calls Diagnostic::message on the Diagnostic wrapped by this Error.
sourcepub fn advices(&self, visitor: &mut dyn Visit) -> Result<()>
pub fn advices(&self, visitor: &mut dyn Visit) -> Result<()>
Calls Diagnostic::advices on the Diagnostic wrapped by this Error.
sourcepub fn verbose_advices(&self, visitor: &mut dyn Visit) -> Result<()>
pub fn verbose_advices(&self, visitor: &mut dyn Visit) -> Result<()>
Calls Diagnostic::verbose_advices on the Diagnostic wrapped by this Error.
sourcepub fn location(&self) -> Location<'_>
pub fn location(&self) -> Location<'_>
Calls Diagnostic::location on the Diagnostic wrapped by this Error.
Calls Diagnostic::tags on the Diagnostic wrapped by this Error.
sourcepub fn source(&self) -> Option<&dyn Diagnostic>
pub fn source(&self) -> Option<&dyn Diagnostic>
Calls Diagnostic::source on the Diagnostic wrapped by this Error.
Trait Implementations§
source§impl AsRef<dyn Diagnostic> for Error
impl AsRef<dyn Diagnostic> for Error
source§fn as_ref(&self) -> &(dyn Diagnostic + 'static)
fn as_ref(&self) -> &(dyn Diagnostic + 'static)
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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
source§impl<E> DiagnosticExt for Ewhere
E: AsDiagnostic,
impl<E> DiagnosticExt for Ewhere
E: AsDiagnostic,
source§fn context<M>(self, message: M) -> Error
fn context<M>(self, message: M) -> Error
message as a message and
description, and self as a source diagnostic. This is useful to
create chains of diagnostics, where high level errors wrap lower level
causes.source§fn with_category(self, category: &'static Category) -> Error
fn with_category(self, category: &'static Category) -> Error
category if self
doesn’t already have one.source§fn with_file_path(self, path: impl AsResource) -> Error
fn with_file_path(self, path: impl AsResource) -> Error
path if self
doesn’t already have one.source§fn with_file_span(self, span: impl AsSpan) -> Error
fn with_file_span(self, span: impl AsSpan) -> Error
span instead of the one in self.source§fn with_file_source_code(self, source_code: impl AsSourceCode) -> Error
fn with_file_source_code(self, source_code: impl AsSourceCode) -> Error
source_code if self
doesn’t already have one.tags