dirscent 0.1.0

Directory descent
Documentation
/*!
`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:?}"),
    }
}
```
*/
mod dir_entry;
mod dirscent;
mod error;

use std::path::Path;

pub use crate::dir_entry::DirEntry;
pub use crate::dirscent::Dirscent;
pub use crate::error::Error;

/// Creates an [iterator][Dirscent] that starts at the directory entry under the path.
///
/// Returns an error if fails to read the metadata.
pub fn dirscent(path: impl AsRef<Path>) -> Result<Dirscent, Error> {
    Dirscent::new(path)
}