folder 0.7.0

The package allows for scanning directories in parallel.
Documentation

Folder Package Documentation Build

The package allows for scanning directories in parallel.

Examples

Synchronously:

use std::path::{Path, PathBuf};

let filter = |path: &Path| path.ends_with(".rs");
let map = |path: PathBuf, _| path.metadata().unwrap().len();
let _ = folder::scan("src", filter, map, ())
    .fold(0, |sum, value| sum + value);

Asynchronously:

use std::path::{Path, PathBuf};

use futures::stream::StreamExt;

let filter = |path: &Path| path.ends_with(".rs");
let map = |path: PathBuf, _| async move { path.metadata().unwrap().len() };
let _ = folder::scan("src", filter, map, ())
    .fold(0, |sum, value| async move { sum + value })
    .await;

Contribution

Your contribution is highly appreciated. Do not hesitate to open an issue or a pull request. Note that any contribution submitted for inclusion in the project will be licensed according to the terms given in LICENSE.md.