folder

Crates.iofolder
lib.rsfolder
version0.9.0
created_at2023-02-09 07:07:27.971242+00
updated_at2024-12-28 09:34:36.223723+00
descriptionThe package allows for scanning directories in parallel.
homepagehttps://github.com/stainless-steel/folder
repositoryhttps://github.com/stainless-steel/folder
max_upload_size
id780559
size11,801
Owners (github:buoyantio:owners)

documentation

https://docs.rs/folder

README

Folder Package Documentation Build

The package allows for scanning directories in parallel.

Examples

Synchronously:

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

use folder::scan;

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

Asynchronously:

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

use folder::asynchronous::scan;
use futures::stream::StreamExt;

let filter = |path: &Path| path.ends_with(".rs");
let map = |path: PathBuf, _| async move { path.metadata().unwrap().len() };
let fold = |sum, value| async move { sum + value };
let _ = scan("src", filter, map, (), None).fold(0, fold).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.

Commit count: 16

cargo fmt