disk_forensic/report.rs
1//! Human-readable text rendering of a [`DiskReport`].
2//!
3//! Each scheme already has a renderer in its own crate; this delegates to the
4//! right one so the unified CLI prints a scheme-appropriate report.
5
6use crate::DiskReport;
7
8/// Render a disk analysis as a multi-line text report.
9#[must_use]
10pub fn text_report(report: &DiskReport) -> String {
11 match report {
12 DiskReport::Apm(a) => apm_forensic::report::text_report(a),
13 // Both carry an MbrAnalysis; mbr-forensic's renderer already includes
14 // the GPT cross-check section for the Gpt case.
15 DiskReport::Mbr(m) | DiskReport::Gpt(m) => mbr_forensic::report::text_report(m),
16 }
17}