6 releases (3 breaking)
Uses new Rust 2024
new 0.4.1 | Mar 12, 2025 |
---|---|
0.4.0 | Feb 22, 2025 |
0.3.0 | Oct 13, 2024 |
0.2.0 | Oct 9, 2024 |
0.1.1 | Sep 26, 2024 |
#1499 in Filesystem
232 downloads per month
Used in workspace_root
16KB
298 lines
Get Dir
An utility to get directory.
This utility searches for a target directory by checking for any directories or files that match the provided input.
Usage
Get directory by target with the following code:
use get_dir::{
GetDir,
Target,
DirTarget,
};
GetDir::new()
.targets(vec![
Target::Dir(DirTarget {
name: "src",
}),
])
.run();
Or get directory by target in reverse with the following code:
use get_dir::{
GetDir,
Target,
FileTarget,
};
GetDir::new()
.targets(vec![
Target::File(FileTarget {
name: "LICENSE",
}),
])
.run_reverse();
Async version also available with async-std
/async_std
and tokio
features:
// This is a `async-std` example
use get_dir::{
GetDir,
Target,
DirTarget,
async_std::GetDirAsyncExt,
};
GetDir::new()
.targets(vec![
Target::Dir(DirTarget {
name: "src",
}),
])
.run_async()
.await;
// This is a `tokio` example
use get_dir::{
GetDir,
Target,
DirTarget,
tokio::GetDirAsyncExt,
};
GetDir::new()
.targets(vec![
Target::Dir(DirTarget {
name: "src",
}),
])
.run_async()
.await;
License
This project is licensed under the terms of the MIT license.
Dependencies
~0–11MB
~124K SLoC