#![forbid(unsafe_code)]
#![forbid(clippy::disallowed_macros, clippy::disallowed_methods)]
pub mod address;
mod align;
mod diff;
mod error;
mod matcher;
mod meta;
mod normalize;
mod objects;
mod open;
pub(crate) mod compare;
pub mod model;
pub mod options;
pub mod output;
pub use error::{LimitKind, OpenErrorKind, ReadErrorKind, SheetsDiffError};
pub use model::{
AlignmentSummary, CellChangeKind, CellDateTime, CellDiff, CellDisplay, CellDuration, CellError,
CellNumberFormat, CellSnapshot, CellValue, DateTimeKind, Diagnostic, DiagnosticKind,
DiagnosticLocation, DiagnosticSummary, DiffMetrics, DiffStage, DiffSummary, DisplaySource,
FormatChange, FormulaChange, FormulaText, MatchConfidence, Severity, SheetChange, SheetDiff,
SheetMatchReason, SheetRef, SheetSummary, Side, SourceDescription, SourceKind, ValueChange,
ValueDifferenceKind, WorkbookChange, WorkbookDiff, WorkbookObjectChange, WorkbookSideInfo,
};
pub use address::{CellAddress, ComparedRange, MAX_COL, MAX_COL_LABEL, MAX_ROW};
pub use objects::ObjectCompareMode;
pub use options::{
AlignmentMode, Cancellation, ComparisonOptions, DateComparePolicy, DiagnosticOptions,
DiffEvent, DiffOptions, DiffOptionsBuilder, ExecutionMode, ExecutionOptions, FormatCompareMode,
FormulaCompareMode, Limits, MatchingOptions, NumberComparePolicy, NumericTypePolicy,
OutputOptions, ProgressSink, SheetMatchingMode, TypeMismatchPolicy, ValueCompareOptions,
};
use std::io::{Read, Seek};
use std::path::Path;
pub fn compare_paths(
old: impl AsRef<Path>,
new: impl AsRef<Path>,
) -> Result<WorkbookDiff, SheetsDiffError> {
diff::run_compare_paths(old, new, DiffOptions::default())
}
pub fn compare_paths_with_options(
old: impl AsRef<Path>,
new: impl AsRef<Path>,
opts: DiffOptions,
) -> Result<WorkbookDiff, SheetsDiffError> {
diff::run_compare_paths(old, new, opts)
}
pub fn compare_bytes(
old: impl AsRef<[u8]>,
new: impl AsRef<[u8]>,
) -> Result<WorkbookDiff, SheetsDiffError> {
diff::run_compare_bytes(old, new, DiffOptions::default())
}
pub fn compare_bytes_with_options(
old: impl AsRef<[u8]>,
new: impl AsRef<[u8]>,
opts: DiffOptions,
) -> Result<WorkbookDiff, SheetsDiffError> {
diff::run_compare_bytes(old, new, opts)
}
pub fn compare_readers<R1, R2>(old: R1, new: R2) -> Result<WorkbookDiff, SheetsDiffError>
where
R1: Read + Seek,
R2: Read + Seek,
{
diff::run_compare_readers(old, new, DiffOptions::default())
}
pub fn compare_readers_with_options<R1, R2>(
old: R1,
new: R2,
opts: DiffOptions,
) -> Result<WorkbookDiff, SheetsDiffError>
where
R1: Read + Seek,
R2: Read + Seek,
{
diff::run_compare_readers(old, new, opts)
}
#[doc = include_str!("../docs/src/migration/v1-to-v2.md")]
#[cfg(doctest)]
pub struct MigrationGuideDoctests;
#[doc = include_str!("../docs/src/api-guide.md")]
#[cfg(doctest)]
pub struct ApiGuideDoctests;
#[doc = include_str!("../docs/src/semantics.md")]
#[cfg(doctest)]
pub struct SemanticsDoctests;
#[doc = include_str!("../docs/src/non-goals.md")]
#[cfg(doctest)]
pub struct NonGoalsDoctests;