1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*!
`dirscent` provides a simple and efficient iterator over the entries of a directory, and,
recursively, over the entries of all subdirectories.
# Install
Add the dependency to your `Cargo.toml`
```toml
[dependencies]
dirscent = "0.1"
```
Or from the command line
```text
% cargo add dirscent@0.1
```
# Example
Iterate down the directory skipping the entries for which the process does not have permissions
```no_run
use dirscent::dirscent;
for it in dirscent("/usr").unwrap().skip_permission_denied() {
match it {
Ok(entry) => println!("{}", entry.path().display()),
Err(err) => eprintln!("{err:?}"),
}
}
```
*/
use Path;
pub use crateDirEntry;
pub use crateDirscent;
pub use crateError;
/// Creates an [iterator][Dirscent] that starts at the directory entry under the path.
///
/// Returns an error if fails to read the metadata.