Skip to main content

Crate walkthrough

Crate walkthrough 

Source
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§

ErrorKind
Distinguishes the cause of a traversal [Error].

Type Aliases§

Result
Type alias for results that may contain a traversal Error.