Skip to content

Commit 349f3ac

Browse files
committed
More docs for the dir module
1 parent d988c65 commit 349f3ac

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/dir.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! List directory contents
2+
13
use crate::{Error, NixPath, Result};
24
use crate::errno::Errno;
35
use crate::fcntl::{self, OFlag};
@@ -114,6 +116,7 @@ fn next(dir: &mut Dir) -> Option<Result<Entry>> {
114116
}
115117
}
116118

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

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

189+
/// Type of file referenced by a directory entry
186190
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
187191
pub enum Type {
192+
/// FIFO (Named pipe)
188193
Fifo,
194+
/// Character device
189195
CharacterDevice,
196+
/// Directory
190197
Directory,
198+
/// Block device
191199
BlockDevice,
200+
/// Regular file
192201
File,
202+
/// Symbolic link
193203
Symlink,
204+
/// Unix-domain socket
194205
Socket,
195206
}
196207

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ mod macros;
6565
#[cfg(not(target_os = "redox"))]
6666
feature! {
6767
#![feature = "dir"]
68-
#[allow(missing_docs)]
6968
pub mod dir;
7069
}
7170
feature! {

0 commit comments

Comments
 (0)