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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#![warn(missing_docs)]
#![recursion_limit="100"]
extern crate openat;
extern crate sha2;
extern crate blake2;
extern crate digest_writer;
extern crate generic_array;
extern crate itertools;
#[macro_use] extern crate log;
#[macro_use] extern crate quick_error;
#[cfg(feature="threads")] extern crate num_cpus;
#[cfg(feature="threads")] extern crate futures;
#[cfg(feature="threads")] extern crate futures_cpupool;
#[cfg(test)] #[macro_use] extern crate pretty_assertions;
#[cfg(test)]
#[macro_use] extern crate matches;
#[cfg(test)]
extern crate rustc_hex;
pub mod v1;
mod error;
mod config;
mod hash_type;
mod read;
pub use error::Error;
pub use read::get_hash;
use std::path::PathBuf;
pub struct ScannerConfig {
threads: usize,
queue_size: Option<usize>,
hash: HashType,
block_size: u64,
dirs: Vec<(PathBuf, PathBuf)>,
print_progress: bool,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub struct HashType(HashTypeEnum);
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[allow(non_camel_case_types)]
enum HashTypeEnum {
Sha512_256,
Blake2b_256,
}