pub struct Entry {Show 23 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 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.
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
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
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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