Skip to main content

Diff

Struct Diff 

Source
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

Source

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.

Source

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.

Source

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>
where R1: Read + Seek, R2: Read + Seek,

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.

Source

pub fn diff(&mut self) -> Diff

Returns a clone of this diff (kept for v1.1.4 source compatibility).

Trait Implementations§

Source§

impl Clone for Diff

Source§

fn clone(&self) -> Diff

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Diff

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Diff

§

impl RefUnwindSafe for Diff

§

impl Send for Diff

§

impl Sync for Diff

§

impl Unpin for Diff

§

impl UnsafeUnpin for Diff

§

impl UnwindSafe for Diff

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.