ReportGenerator

Trait ReportGenerator 

Source
pub trait ReportGenerator {
    // Required methods
    fn generate(
        &self,
        ctx: &ReportContext<'_>,
        output_path: &Path,
    ) -> Result<(), Box<dyn Error>>;
    fn render(&self, ctx: &ReportContext<'_>) -> Result<String, Box<dyn Error>>;
}
Expand description

Trait for report generators

Required Methods§

Source

fn generate( &self, ctx: &ReportContext<'_>, output_path: &Path, ) -> Result<(), Box<dyn Error>>

Generate a report to a file

§Errors

Returns an error if report generation or file writing fails

Source

fn render(&self, ctx: &ReportContext<'_>) -> Result<String, Box<dyn Error>>

Generate report content as a string

§Errors

Returns an error if report generation fails

Implementors§