pub struct ReportGenerator;Expand description
Report generator Phase 1: Basic YAML output generation
Implementations§
Source§impl ReportGenerator
impl ReportGenerator
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new report generator
§Examples
use organizational_intelligence_plugin::report::ReportGenerator;
let generator = ReportGenerator::new();Sourcepub fn to_yaml(&self, report: &AnalysisReport) -> Result<String>
pub fn to_yaml(&self, report: &AnalysisReport) -> Result<String>
Convert report to YAML string
§Arguments
report- The analysis report to serialize
§Errors
Returns error if serialization fails
§Examples
use organizational_intelligence_plugin::report::{
ReportGenerator, AnalysisReport, AnalysisMetadata
};
let generator = ReportGenerator::new();
let metadata = AnalysisMetadata {
organization: "test-org".to_string(),
analysis_date: "2025-11-15T00:00:00Z".to_string(),
repositories_analyzed: 10,
commits_analyzed: 100,
analyzer_version: "0.1.0".to_string(),
};
let report = AnalysisReport {
version: "1.0".to_string(),
metadata,
defect_patterns: vec![],
};
let yaml = generator.to_yaml(&report).expect("Should serialize");
assert!(yaml.contains("version"));Sourcepub async fn write_to_file(
&self,
report: &AnalysisReport,
path: &Path,
) -> Result<()>
pub async fn write_to_file( &self, report: &AnalysisReport, path: &Path, ) -> Result<()>
Write report to file
§Arguments
report- The analysis report to writepath- Path to output file
§Errors
Returns error if:
- Serialization fails
- File write fails
- Path is invalid
§Examples
use organizational_intelligence_plugin::report::{
ReportGenerator, AnalysisReport, AnalysisMetadata
};
use std::path::PathBuf;
let generator = ReportGenerator::new();
let metadata = AnalysisMetadata {
organization: "test-org".to_string(),
analysis_date: "2025-11-15T00:00:00Z".to_string(),
repositories_analyzed: 10,
commits_analyzed: 100,
analyzer_version: "0.1.0".to_string(),
};
let report = AnalysisReport {
version: "1.0".to_string(),
metadata,
defect_patterns: vec![],
};
generator.write_to_file(&report, &PathBuf::from("report.yaml")).await?;Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReportGenerator
impl RefUnwindSafe for ReportGenerator
impl Send for ReportGenerator
impl Sync for ReportGenerator
impl Unpin for ReportGenerator
impl UnwindSafe for ReportGenerator
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.