#[non_exhaustive]pub enum DirEntryType {
Unknown,
Fifo,
CharDevice,
Directory,
BlockDevice,
Regular,
Symlink,
Socket,
Whiteout,
Other(u8),
}Expand description
A directory-entry file type (d_type, DT_* in dir.h).
#[non_exhaustive] so a later phase can add a variant without a breaking
change; consumers matching this enum use a _ arm. An undefined type byte is
carried as DirEntryType::Other so an unknown value is reported with its
evidence rather than hidden.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unknown
DT_UNKNOWN (0) — the entry does not record a type (old-format dirs).
Fifo
DT_FIFO (1) — named pipe / FIFO.
CharDevice
DT_CHR (2) — character device.
Directory
DT_DIR (4) — directory.
BlockDevice
DT_BLK (6) — block device.
Regular
DT_REG (8) — regular file.
Symlink
DT_LNK (10) — symbolic link.
Socket
DT_SOCK (12) — UNIX-domain socket.
Whiteout
DT_WHT (14) — whiteout.
Other(u8)
A d_type value not defined by the format — carries the raw byte so an
unknown type is reported with its evidence.
Implementations§
Source§impl DirEntryType
impl DirEntryType
Sourcepub fn from_d_type(d_type: u8) -> Self
pub fn from_d_type(d_type: u8) -> Self
Classify a directory-entry type from the raw d_type byte.
Trait Implementations§
Source§impl Clone for DirEntryType
impl Clone for DirEntryType
Source§fn clone(&self) -> DirEntryType
fn clone(&self) -> DirEntryType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more