pub struct JsonFormatter { /* private fields */ }Expand description
JSON formatter for analysis results
Implementations§
Source§impl JsonFormatter
impl JsonFormatter
Sourcepub fn with_pretty(self, pretty: bool) -> Self
pub fn with_pretty(self, pretty: bool) -> Self
Enable or disable pretty printing
Sourcepub fn with_metadata(
self,
tool_version: impl Into<String>,
log_files_processed: Vec<String>,
total_log_entries: usize,
) -> Self
pub fn with_metadata( self, tool_version: impl Into<String>, log_files_processed: Vec<String>, total_log_entries: usize, ) -> Self
Set metadata values for output
Sourcepub fn tool_version(&self) -> &str
pub fn tool_version(&self) -> &str
Get the tool version
Sourcepub fn log_files_processed(&self) -> &[String]
pub fn log_files_processed(&self) -> &[String]
Get the log files processed
Sourcepub fn total_log_entries(&self) -> usize
pub fn total_log_entries(&self) -> usize
Get the total log entries count
Sourcepub fn metadata_object(&self) -> Value
pub fn metadata_object(&self) -> Value
Get metadata object (made public for testing)
Sourcepub fn format(&self, analysis: &AnalysisResult) -> Result<String>
pub fn format(&self, analysis: &AnalysisResult) -> Result<String>
Format a single AnalysisResult as structured JSON
Sourcepub fn format_with_timing(
&self,
analysis: &AnalysisResult,
timing: &TimingAnalysis,
) -> Result<String>
pub fn format_with_timing( &self, analysis: &AnalysisResult, timing: &TimingAnalysis, ) -> Result<String>
Format with timing analysis included
Sourcepub fn format_findings(&self, findings: &FindingSet) -> Result<String>
pub fn format_findings(&self, findings: &FindingSet) -> Result<String>
Format structured findings as compact, versioned JSON.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsonFormatter
impl RefUnwindSafe for JsonFormatter
impl Send for JsonFormatter
impl Sync for JsonFormatter
impl Unpin for JsonFormatter
impl UnsafeUnpin for JsonFormatter
impl UnwindSafe for JsonFormatter
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