Skip to main content

FileEntry

Struct FileEntry 

Source
pub struct FileEntry {
Show 17 fields pub path: OsString, pub full_path: PathBuf, pub filesystem_identity: (u64, u64), pub is_dir: bool, pub is_executable: bool, pub is_hidden: bool, pub mode: u32, pub size: u64, pub size_incomplete: bool, pub modified: SystemTime, pub owner: String, pub group: String, pub user_id: u32, pub group_id: u32, pub nlink: u64, pub git_status: Option<GitStatus>, pub symlink: Option<Symlink>,
}

Fields§

§path: OsString§full_path: PathBuf

Absolute listing path, kept separate from the formatted display name.

§filesystem_identity: (u64, u64)

Device and inode used to recognise system folders and configured paths.

§is_dir: bool§is_executable: bool§is_hidden: bool§mode: u32§size: u64§size_incomplete: bool§modified: SystemTime§owner: String§group: String§user_id: u32§group_id: u32§nlink: u64§git_status: Option<GitStatus>§symlink: Option<Symlink>

Implementations§

Source§

impl FileEntry

Source

pub fn get_icon_custom<'a>(&self, config: &'a IconConfig) -> &'a str

Source

pub fn get_file_type(&self) -> FileType

Source

pub fn display_name(&self) -> Cow<'_, str>

Source

pub fn format_permissions(&self) -> String

Source

pub fn permission_chars(&self) -> [char; 10]

The ls -l permission string as characters, without allocating.

Source

pub fn format_size(&self) -> FormattedSize

Trait Implementations§

Source§

impl Clone for FileEntry

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FileEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.