pub struct Diff {
pub old_filepath: String,
pub new_filepath: String,
pub sheet_diff: Vec<SheetDiff>,
pub cell_diffs: Vec<SheetCellDiff>,
}Expand description
Top-level diff result between two .xlsx workbooks.
Fields§
§old_filepath: String§new_filepath: String§sheet_diff: Vec<SheetDiff>§cell_diffs: Vec<SheetCellDiff>Implementations§
Source§impl Diff
impl Diff
Sourcepub fn new(old_filepath: &str, new_filepath: &str) -> Self
pub fn new(old_filepath: &str, new_filepath: &str) -> Self
Panicking convenience constructor.
Opens both workbooks and computes their diff. Panics with a diagnostic message if either workbook cannot be opened or read.
Existing callers of v1.1.4’s Diff::new can continue to use this
without any source changes.
For production embedders and GUI applications, prefer Diff::try_new
to receive a structured SheetsDiffError instead of a panic.
Sourcepub fn try_new(
old_filepath: impl AsRef<Path>,
new_filepath: impl AsRef<Path>,
) -> Result<Self, SheetsDiffError>
pub fn try_new( old_filepath: impl AsRef<Path>, new_filepath: impl AsRef<Path>, ) -> Result<Self, SheetsDiffError>
Fallible path-based constructor.
Accepts any value that can be treated as a Path, including &str,
String, and PathBuf. Returns a structured error for missing,
corrupt, locked, or non-.xlsx inputs without panicking.
Sourcepub fn try_from_named_readers<R1, R2>(
old_name: impl Into<String>,
old_reader: R1,
new_name: impl Into<String>,
new_reader: R2,
) -> Result<Self, SheetsDiffError>
pub fn try_from_named_readers<R1, R2>( old_name: impl Into<String>, old_reader: R1, new_name: impl Into<String>, new_reader: R2, ) -> Result<Self, SheetsDiffError>
Fallible reader-based constructor with explicit display names.
Accepts any Read + Seek stream (e.g. std::io::Cursor). The
old_name / new_name strings are stored in the returned
Diff.old_filepath / Diff.new_filepath fields and appear in diff
output — supply meaningful labels (filenames, Git object hashes, etc.).
This constructor lets GUI and VCS tools avoid double I/O and lossy path-to-string conversions.