Trait ToPrettyDiagnostic

Source
pub trait ToPrettyDiagnostic {
    // Required methods
    fn to_pretty_diagnostic<'a>(
        &'a self,
        cm: &'a SourceMap,
        skip_filename: bool,
    ) -> PrettyDiagnostic<'a>;
    fn to_pretty_string<'a>(
        &self,
        cm: &'a SourceMap,
        skip_filename: bool,
        handler: &'a GraphicalReportHandler,
    ) -> String;
}

Required Methods§

Source

fn to_pretty_diagnostic<'a>( &'a self, cm: &'a SourceMap, skip_filename: bool, ) -> PrettyDiagnostic<'a>

Source

fn to_pretty_string<'a>( &self, cm: &'a SourceMap, skip_filename: bool, handler: &'a GraphicalReportHandler, ) -> String

Implementations on Foreign Types§

Source§

impl ToPrettyDiagnostic for Diagnostic

Source§

fn to_pretty_diagnostic<'a>( &'a self, cm: &'a SourceMap, skip_filename: bool, ) -> PrettyDiagnostic<'a>

Returns a pretty-printed of the diagnostic.

Source§

fn to_pretty_string<'a>( &self, cm: &'a SourceMap, skip_filename: bool, handler: &'a GraphicalReportHandler, ) -> String

Converts the diagnostic into a pretty-printed string, suitable for display.

This method is used to generate a human-readable string representation of the diagnostic. It utilizes the PrettyDiagnostic struct to format the diagnostic information.

§Parameters
  • cm: A reference to the SourceMap used for mapping source code locations.
  • skip_filename: A boolean indicating whether to skip including filenames in the output.
  • handler: A reference to the GraphicalReportHandler used for handling graphical reports.
§Returns

A String containing the pretty-printed diagnostic information.

Implementors§