#[non_exhaustive]pub struct WorkbookDiff {
pub old: WorkbookSideInfo,
pub new: WorkbookSideInfo,
pub sheets: Vec<SheetDiff>,
pub workbook_changes: Vec<WorkbookChange>,
pub object_changes: Vec<WorkbookObjectChange>,
pub diagnostics: Vec<Diagnostic>,
pub summary: DiffSummary,
pub metrics: DiffMetrics,
}Expand description
The complete diff result for a workbook pair.
workbook_changes and object_changes are always empty — RFC-021/023
surface their findings through diagnostics, and structured variants
await a future release. The struct is #[non_exhaustive] so
they can be populated additively without a breaking change.
§Extracting a lightweight summary
summary (DiffSummary), metrics (DiffMetrics), and each sheet’s
change (SheetChange) are all cheap, small, owned values. Memory-conscious
consumers that only need counts and the sheet-change list can clone those out
and drop the whole WorkbookDiff — including the potentially large
sheets[..].cell_diffs vectors — at their adapter boundary:
let diff = compare_paths("a.xlsx", "b.xlsx")?;
let summary = diff.summary.clone(); // cheap
let metrics = diff.metrics.clone(); // cheap
let sheet_changes: Vec<_> =
diff.sheets.iter().map(|s| s.change.clone()).collect();
drop(diff); // releases all cell_diffsFields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.old: WorkbookSideInfo§new: WorkbookSideInfo§sheets: Vec<SheetDiff>Sheet diffs in old-workbook sheet order (then new-workbook order for added sheets).
workbook_changes: Vec<WorkbookChange>Always empty; reserved for future structured workbook-level changes.
object_changes: Vec<WorkbookObjectChange>Always empty; reserved for future structured object-level changes.
diagnostics: Vec<Diagnostic>§summary: DiffSummary§metrics: DiffMetricsProcessing metrics for benchmarking and performance analysis (RFC-024/027).
Trait Implementations§
Source§impl Clone for WorkbookDiff
impl Clone for WorkbookDiff
Source§fn clone(&self) -> WorkbookDiff
fn clone(&self) -> WorkbookDiff
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more