pub struct FileDetails {
pub size: u64,
pub modified: Option<i64>,
pub mode: Option<u32>,
pub readonly: bool,
}Expand description
What one entry is besides its name: its size, when it changed last, and its permissions.
A symbolic link is read as itself rather than as what it points at, the way the rows show it: a link out of the folder must not be followed for a number on screen.
Fields§
§size: u64Its size in bytes. A folder’s own size says how big the folder itself is on disk, not what is in it; adding up a folder means reading all of it, which a manager never does by itself.
modified: Option<i64>When it changed last, in seconds since 1970-01-01 UTC, or None where the system does not
say.
mode: Option<u32>The permission bits, where the platform has them (unix), and None where it does not.
readonly: boolWhether it may not be written, which every platform says.
Implementations§
Source§impl FileDetails
impl FileDetails
Sourcepub fn read(path: &Path) -> Option<Self>
pub fn read(path: &Path) -> Option<Self>
Reads the details of the entry at path, or None when the system says nothing about it
— it is gone, or may not be looked at.
This touches the disk, so it belongs on a background thread;
FileManagerState asks for it with
Command::perform and never while drawing.
Sourcepub fn size_text(&self, folder: bool) -> String
pub fn size_text(&self, folder: bool) -> String
The size in the largest unit that leaves a number worth reading: 840 B, 9.4 kB,
12 MB. A folder’s size is left out, because its own size says nothing about what is in
it and a number that means nothing is worse than none.
Sourcepub fn modified_text(&self) -> String
pub fn modified_text(&self) -> String
When it changed last, as the year, the month, the day and the clock the machine stands by:
2026-09-20 14:32. Empty where the system does not say.
Sourcepub fn permissions_text(&self, folder: bool) -> String
pub fn permissions_text(&self, folder: bool) -> String
Who may do what with it: the nine letters unix writes them with (rwxr-xr-x), and on a
platform without them the one thing it does say, whether the entry may be written.
Trait Implementations§
Source§impl Clone for FileDetails
impl Clone for FileDetails
Source§fn clone(&self) -> FileDetails
fn clone(&self) -> FileDetails
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FileDetails
Source§impl Debug for FileDetails
impl Debug for FileDetails
impl Eq for FileDetails
Source§impl PartialEq for FileDetails
impl PartialEq for FileDetails
impl StructuralPartialEq for FileDetails
Auto Trait Implementations§
impl Freeze for FileDetails
impl RefUnwindSafe for FileDetails
impl Send for FileDetails
impl Sync for FileDetails
impl Unpin for FileDetails
impl UnsafeUnpin for FileDetails
impl UnwindSafe for FileDetails
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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