sys-compare/src/createmode.rs

25 lines
641 B
Rust
Raw Normal View History

2024-03-18 22:04:24 +00:00
use Fasching::create_snapshot;
use Fasching::hasher::HashType::BLAKE3;
2024-03-18 21:47:21 +00:00
use Fasching::snapshot::Snapshot;
use crate::syscompare::Comparer;
2024-03-18 21:51:52 +00:00
pub struct CreateMode {
2024-03-18 22:04:24 +00:00
in_path: String,
out_path: String,
args: Vec<String>,
2024-03-18 21:47:21 +00:00
snapshot: Snapshot
}
impl CreateMode {
2024-03-18 22:04:24 +00:00
pub fn new(args: Vec<String>, in_path: String, out_path: String) -> CreateMode {
CreateMode { in_path, out_path, args, snapshot: Default::default() }
2024-03-18 21:47:21 +00:00
}
}
impl Comparer for CreateMode {
fn run(&self) {
2024-03-18 22:04:24 +00:00
let snapshot = create_snapshot(self.in_path.as_str(), BLAKE3);
println!("{}", snapshot.file_hashes.lock().unwrap().len())
2024-03-18 21:47:21 +00:00
}
}