pub trait ErrorTypeExt: ErrorType {
// Provided methods
fn fmt_as_annotate_snippets(&self) -> String { ... }
fn fmt_as_annotate_snippets_with_opts(&self, opts: FormatOptions) -> String { ... }
fn fmt_as_ariadne_report(&self) -> Result<String, Error> { ... }
fn fmt_as_ariadne_report_with(
&self,
config: Config,
) -> Result<String, Error> { ... }
fn as_codespan_diagnostic(
&self,
) -> (Diagnostic<usize>, SimpleFiles<<Self::Span as Span>::Uri, <Self::Span as Span>::Source>) { ... }
fn fmt_as_codespan_diagnostic_with(
&self,
config: Config,
styles: Option<&Styles>,
) -> Result<String, Error> { ... }
fn as_miette_diagnostic(&self) -> impl Diagnostic
where Self::Span: Send + Sync { ... }
fn fmt_as_miette_diagnostic_with(
&self,
handler: &impl ReportHandler,
) -> String
where Self: Sized + 'static,
Self::Span: Send + Sync { ... }
}Expand description
Conversion to other diagnostic types.
Provided Methods§
Sourcefn fmt_as_annotate_snippets(&self) -> String
fn fmt_as_annotate_snippets(&self) -> String
Format the error as an annotate snippet.
Sourcefn fmt_as_annotate_snippets_with_opts(&self, opts: FormatOptions) -> String
fn fmt_as_annotate_snippets_with_opts(&self, opts: FormatOptions) -> String
Format the error as an annotate snippet with format options.
Sourcefn fmt_as_ariadne_report(&self) -> Result<String, Error>
fn fmt_as_ariadne_report(&self) -> Result<String, Error>
Format the error as an Ariadne report.
Sourcefn fmt_as_ariadne_report_with(&self, config: Config) -> Result<String, Error>
fn fmt_as_ariadne_report_with(&self, config: Config) -> Result<String, Error>
Format the error as an Ariadne report with Ariadne config.
Sourcefn as_codespan_diagnostic(
&self,
) -> (Diagnostic<usize>, SimpleFiles<<Self::Span as Span>::Uri, <Self::Span as Span>::Source>)
fn as_codespan_diagnostic( &self, ) -> (Diagnostic<usize>, SimpleFiles<<Self::Span as Span>::Uri, <Self::Span as Span>::Source>)
Format the error as an Codespan diagnostic.
Sourcefn fmt_as_codespan_diagnostic_with(
&self,
config: Config,
styles: Option<&Styles>,
) -> Result<String, Error>
fn fmt_as_codespan_diagnostic_with( &self, config: Config, styles: Option<&Styles>, ) -> Result<String, Error>
Format the error as an Codespan diagnostic with Codespan config.
Sourcefn as_miette_diagnostic(&self) -> impl Diagnostic
fn as_miette_diagnostic(&self) -> impl Diagnostic
Convert the error to a Miette diagnostic.
Sourcefn fmt_as_miette_diagnostic_with(&self, handler: &impl ReportHandler) -> String
fn fmt_as_miette_diagnostic_with(&self, handler: &impl ReportHandler) -> String
Format the error as a Miette diagnostic with a Miette handler.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.