1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#![allow(non_snake_case)]
extern crate core;

use crate::hasher::HashType;
use crate::snapshot::{
    compare_hashes, export, import, Snapshot, SnapshotChangeType, SnapshotCompareResult,
};
use anyhow::Error;
use std::path::Path;
pub mod hasher;
pub mod snapshot;

pub fn create_snapshot(
    path: &str,
    hash_type: HashType,
    black_list: Vec<String>,
) -> Result<Snapshot, Error> {
    Snapshot::new(Path::new(path), hash_type, black_list)
}

pub fn compare_snapshots(
    left: Snapshot,
    right: Snapshot,
) -> Option<(SnapshotChangeType, SnapshotCompareResult)> {
    compare_hashes(left, right)
}

pub fn compare_snapshots_including_modify_date(
    left: Snapshot,
    right: Snapshot,
) -> Option<(SnapshotChangeType, SnapshotCompareResult)> {
    compare_hashes(left, right)
}

pub fn export_snapshot(snapshot: Snapshot, path: String, overwrite: bool) -> Result<(), Error> {
    export(snapshot, path, overwrite)
}

pub fn import_snapshot(path: String) -> Result<Snapshot, Error> {
    import(path)
}