Skip to content

Commit

Permalink
More docs for the dir module
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Jul 10, 2022
1 parent d988c65 commit 349f3ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/dir.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! List directory contents
use crate::{Error, NixPath, Result};
use crate::errno::Errno;
use crate::fcntl::{self, OFlag};
Expand Down Expand Up @@ -114,6 +116,7 @@ fn next(dir: &mut Dir) -> Option<Result<Entry>> {
}
}

/// Return type of [`Dir::iter`].
#[derive(Debug, Eq, Hash, PartialEq)]
pub struct Iter<'d>(&'d mut Dir);

Expand Down Expand Up @@ -183,14 +186,22 @@ impl IntoIterator for Dir {
#[repr(transparent)]
pub struct Entry(dirent);

/// Type of file referenced by a directory entry
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
pub enum Type {
/// FIFO (Named pipe)
Fifo,
/// Character device
CharacterDevice,
/// Directory
Directory,
/// Block device
BlockDevice,
/// Regular file
File,
/// Symbolic link
Symlink,
/// Unix-domain socket
Socket,
}

Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ mod macros;
#[cfg(not(target_os = "redox"))]
feature! {
#![feature = "dir"]
#[allow(missing_docs)]
pub mod dir;
}
feature! {
Expand Down

0 comments on commit 349f3ac

Please sign in to comment.