PathDirExt

Trait PathDirExt 

Source
pub trait PathDirExt: AsRef<Path> {
    // Provided method
    fn walk(&self) -> WalkDir { ... }
}
Expand description

Extension method on the Path type.

Provided Methods§

Source

fn walk(&self) -> WalkDir

Walk the PathDir, returning the WalkDir builder.

§Examples
use ergo_fs::*;

let dir = PathDir::new("src")?;
for entry in dir.walk().max_depth(1) {
    match PathType::from_entry(entry?)? {
        PathType::File(file) => println!("got file {}", file.display()),
        PathType::Dir(dir) => println!("got dir {}", dir.display()),
    }
}

Implementors§