From 349f3acf423f8f38d69eb49b89d2872864b871c4 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sun, 10 Jul 2022 10:28:38 -0600 Subject: More docs for the dir module --- src/dir.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/dir.rs') diff --git a/src/dir.rs b/src/dir.rs index 8f9a2d6f..6d5fc3b9 100644 --- a/src/dir.rs +++ b/src/dir.rs @@ -1,3 +1,5 @@ +//! List directory contents + use crate::{Error, NixPath, Result}; use crate::errno::Errno; use crate::fcntl::{self, OFlag}; @@ -114,6 +116,7 @@ fn next(dir: &mut Dir) -> Option> { } } +/// Return type of [`Dir::iter`]. #[derive(Debug, Eq, Hash, PartialEq)] pub struct Iter<'d>(&'d mut Dir); @@ -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, } -- cgit v1.2.3