pub struct Entry {Show 26 fields
pub path: PathBuf,
pub name: String,
pub kind: EntryKind,
pub size: u64,
pub modified: Option<SystemTime>,
pub created: Option<SystemTime>,
pub accessed: Option<SystemTime>,
pub changed: Option<SystemTime>,
pub mode: u32,
pub readonly: bool,
pub symlink_target: Option<PathBuf>,
pub depth: usize,
pub git_status: GitStatus,
pub is_dir_header: bool,
pub nlink: u64,
pub uid: u32,
pub gid: u32,
pub inode: u64,
pub blocks: u64,
pub dev: u64,
pub rdev: u64,
pub blksize: u64,
pub owner: String,
pub group: String,
pub author: String,
pub context: String,
}Expand description
A single filesystem entry ready for formatting.
Fields§
§path: PathBuf§name: String§kind: EntryKind§size: u64§modified: Option<SystemTime>§created: Option<SystemTime>§accessed: Option<SystemTime>§changed: Option<SystemTime>Status-change time (st_ctime) when available.
mode: u32Permission mode bits (unix) or 0 on platforms without them.
readonly: bool§symlink_target: Option<PathBuf>§depth: usize§git_status: GitStatus§is_dir_header: boolTrue when this entry is a directory listing header (for recursive mode).
nlink: u64Hard link count (st_nlink).
uid: u32§gid: u32§inode: u64§blocks: u64Allocated blocks in 512-byte units (GNU ls -s style) when known.
dev: u64Device ID containing the file (st_dev / stx_dev).
rdev: u64Device ID (if special file) (st_rdev / stx_rdev).
blksize: u64Preferred I/O block size (st_blksize / stx_blksize) when known.
owner: StringOwner name (or numeric string).
group: StringGroup name (or numeric string).
Author (GNU --author); typically same as owner on Linux.
context: StringSELinux security context (-Z); empty if unavailable.
Implementations§
Source§impl Entry
impl Entry
pub fn from_path(path: impl AsRef<Path>, depth: usize) -> Result<Self>
pub fn from_path_with( path: impl AsRef<Path>, depth: usize, fill: MetaFill, ) -> Result<Self>
Sourcepub fn from_path_follow(path: impl AsRef<Path>, depth: usize) -> Result<Self>
pub fn from_path_follow(path: impl AsRef<Path>, depth: usize) -> Result<Self>
Like [from_path] but follow the final symlink target for metadata (-L).
pub fn from_path_follow_with( path: impl AsRef<Path>, depth: usize, fill: MetaFill, ) -> Result<Self>
pub fn from_path_and_meta( path: &Path, meta: &Metadata, depth: usize, ) -> Result<Self>
pub fn from_path_and_meta_with( path: &Path, meta: &Metadata, depth: usize, fill: MetaFill, ) -> Result<Self>
Sourcepub fn dir_header(path: impl AsRef<Path>, depth: usize) -> Self
pub fn dir_header(path: impl AsRef<Path>, depth: usize) -> Self
Create a synthetic directory header for recursive listings.
pub fn is_dir(&self) -> bool
Sourcepub fn type_detail(&self) -> &'static str
pub fn type_detail(&self) -> &'static str
Fine-grained type string for machine formats (file, fifo, socket, …).
pub fn is_executable(&self) -> bool
Sourcepub fn dev_major_minor(&self) -> (u32, u32)
pub fn dev_major_minor(&self) -> (u32, u32)
(major, minor) for st_dev.
Sourcepub fn rdev_major_minor(&self) -> (u32, u32)
pub fn rdev_major_minor(&self) -> (u32, u32)
(major, minor) for st_rdev (special files).
Sourcepub fn xattr_names(&self) -> Vec<String>
pub fn xattr_names(&self) -> Vec<String>
Extended attribute names (listxattr); empty when unsupported or none.
Sourcepub fn mode_perms_octal(&self) -> String
pub fn mode_perms_octal(&self) -> String
Permission bits only (no file-type nibble), as octal string without leading type.
Sourcepub fn mode_full_octal(&self) -> String
pub fn mode_full_octal(&self) -> String
Full mode including type bits when available.
pub fn modified_datetime(&self) -> Option<DateTime<Local>>
pub fn accessed_datetime(&self) -> Option<DateTime<Local>>
pub fn created_datetime(&self) -> Option<DateTime<Local>>
pub fn changed_datetime(&self) -> Option<DateTime<Local>>
pub fn time_for(&self, field: TimeField) -> Option<SystemTime>
pub fn datetime_for(&self, field: TimeField) -> Option<DateTime<Local>>
pub fn extension(&self) -> Option<&str>
Sourcepub fn owner_display(&self, numeric: bool) -> String
pub fn owner_display(&self, numeric: bool) -> String
Owner string for display (-n forces numeric).
pub fn group_display(&self, numeric: bool) -> String
Sourcepub fn fill_expensive(&mut self, fill: MetaFill)
pub fn fill_expensive(&mut self, fill: MetaFill)
Fill owner/group/author (and optional SELinux context) after a cheap stat.
Used so batch statx / io_uring can collect metadata first, then resolve
expensive fields without re-statting.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Entry
impl RefUnwindSafe for Entry
impl Send for Entry
impl Sync for Entry
impl Unpin for Entry
impl UnsafeUnpin for Entry
impl UnwindSafe for Entry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more