Struct dir_signature::ScannerConfig
[−]
[src]
pub struct ScannerConfig { /* fields omitted */ }
Scanner config contains a list of directories you will scan and other settings that influence filesystem scanning
Methods
impl ScannerConfig
[src]
pub fn new() -> ScannerConfig
[src]
Create an empty scanner config with defaults
By default we use sha512/256
hasher as it increases
interoperability, but consider using blake2b/256
as it 25% faster
pub fn hash(&mut self, hash: HashType) -> &mut Self
[src]
Use different hash type
pub fn threads(&mut self, num: usize) -> &mut Self
[src]
Set number of threads to use for scanning
Default is 0 which means don't create additional threads and do hashing and directory scanning in current thread. Otherwise we will create num threads for hashing and will use current thread for scanning directories and priting progress.
This parameter is ignored if "threads" feature is disabled
pub fn auto_threads(&mut self) -> &mut Self
[src]
Set number of threads to the number of CPU cores on the system
This method does nothing if "threads" feature is disabled
pub fn queue_size(&mut self, num: usize) -> &mut Self
[src]
Set number of index entries that can be queued in the background
It only makes sense if threads > 0 and you may need to tweak it only in very memory constraint situations
Default is some value proportional to the number of threads.
pub fn add_dir<P, R>(&mut self, path: P, prefix: R) -> &mut Self where
P: AsRef<Path>,
R: AsRef<Path>,
[src]
P: AsRef<Path>,
R: AsRef<Path>,
Add a directory to the index
prefix
should either be /
or a subdirectory where indexed files
will be placed
pub fn print_progress(&mut self) -> &mut Self
[src]
Enable printing progress to stderr