Expand description
§Recursive Directory Traversal
This crate provides a flexible and efficient way to recursively walk through directories. It handles common tasks like:
- Filtering hidden files.
- Setting minimum and maximum recursion depth.
- Following or ignoring symbolic links.
- Sorting entries within a directory.
- Detecting symbolic link loops to prevent infinite recursion.
§Example
use walkthrough::WalkDir;
for entry in WalkDir::new("src").max_depth(2) {
match entry {
Ok(e) => println!("Found: {:?}", e.path()),
Err(err) => eprintln!("Error: {}", err),
}
}Structs§
- DirEntry
- Directory entry.
- Error
- Error produced during directory traversal.
- Sync
- Synchronous state.
- WalkDir
- Builder for configuring a synchronous directory traversal.
- Walker
- Stateful iterator produced by
WalkDir.
Enums§
- Error
Kind - Distinguishes the cause of a traversal [
Error].