walkkit 0.1.3

Parallel filesystem walker with ignore-aware traversal and bounded work queues
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use walkkit::{WalkItem, Walker};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let walker = Walker::new()
        .add_root("./src")
        .with_parallelism(4)
        .respect_gitignore(true)
        .skip_binary(true);

    for item in walker.walk()? {
        match item {
            WalkItem::File(file) => println!("File: {} ({} bytes)", file.path.display(), file.size),
            WalkItem::Error(err) => eprintln!("Error walking {}: {}", err.path.display(), err),
        }
    }

    Ok(())
}