pub fn render_report(
        &self,
        f: &mut impl fmt::Write,
        diagnostic: &(dyn Diagnostic),
    ) -> fmt::Result {
        self.render_header(f, diagnostic)?;
        writeln!(f)?;
        self.render_causes(f, diagnostic)?;
        self.render_snippets(f, diagnostic)?;
        self.render_footer(f, diagnostic)?;
        self.render_related(f, diagnostic)?;
        if let Some(footer) = &self.footer {
            writeln!(f)?;
            let width = self.termwidth.saturating_sub(4);
            let opts = textwrap::Options::new(width)
                .initial_indent("  ")
                .subsequent_indent("  ");
            writeln!(f, "{}", textwrap::fill(footer, opts))?;
        }
        Ok(())
    }
/// Render a [Diagnostic]. This function is mostly internal and meant to
/// be called by the toplevel [ReportHandler] handler, but is
/// made public to make it easier (possible) to test in isolation from
/// global state.
Render a [Diagnostic]. This function is mostly internal and meant to
be called by the toplevel [ReportHandler] handler, but is
made public to make it easier (possible) to test in isolation from
global state.
Render a [ Diagnostic ] . This function is mostly internal and meant to be called by the toplevel [ ReportHandler ] handler but is made public to make it easier ( possible ) to test in isolation from global state .
pub fn render_report(
        &self,
        f: &mut impl fmt::Write,
        diagnostic: &(dyn Diagnostic),
    ) -> fmt::Result {
        self.render_header(f, diagnostic)?;
        writeln!(f)?;
        self.render_causes(f, diagnostic)?;
        self.render_snippets(f, diagnostic)?;
        self.render_footer(f, diagnostic)?;
        self.render_related(f, diagnostic)?;
        if let Some(footer) = &self.footer {
            writeln!(f)?;
            let width = self.termwidth.saturating_sub(4);
            let opts = textwrap::Options::new(width)
                .initial_indent("  ")
                .subsequent_indent("  ");
            writeln!(f, "{}", textwrap::fill(footer, opts))?;
        }
        Ok(())
    }
pub fn render_report ( & self , f : & mut impl fmt :: Write , diagnostic : & ( dyn Diagnostic ) , ) -> fmt :: Result { self . render_header ( f , diagnostic ) ? ; writeln ! ( f ) ? ; self . render_causes ( f , diagnostic ) ? ; self . render_snippets ( f , diagnostic ) ? ; self . render_footer ( f , diagnostic ) ? ; self . render_related ( f , diagnostic ) ? ; if let Some ( footer ) = & self . footer { writeln ! ( f ) ? ; let width = self . termwidth . saturating_sub ( 4 ) ; let opts = textwrap :: Options :: new ( width ) . initial_indent ( " " ) . subsequent_indent ( " " ) ; writeln ! ( f " " textwrap fill ( footer opts ) ) ? ; } Ok ( ( ) ) }
Render a [Diagnostic].
Render a [ Diagnostic ] .
&self
f
&mut impl fmt::Write
diagnostic
&(dyn Diagnostic)
&self
f
&mut impl fmt::Write
diagnostic
&(dyn Diagnostic)