Struct fm::fileinfo::FileInfo

source ·
pub struct FileInfo {
Show 13 fields pub path: PathBuf, pub filename: String, pub size: u64, pub file_size: String, pub dir_symbol: char, pub permissions: String, pub owner: String, pub group: String, pub system_time: String, pub is_selected: bool, pub file_kind: FileKind, pub extension: String, pub kind_format: String,
}
Expand description

Infos about a file We read and keep tracks every displayable information about a file. Like in exa we don’t display the group.

Fields§

§path: PathBuf

Full path of the file

§filename: String

Filename

§size: u64

size (nb of bytes) of the file

§file_size: String

File size as a String, already human formated.

§dir_symbol: char

First symbol displaying the kind of file.

§permissions: String

Str formatted permissions like rwxr..rw.

§owner: String

Owner name of the file.

§group: String

Group name of the file.

§system_time: String

System time of last modification

§is_selected: bool

Is this file currently selected ?

§file_kind: FileKind

What kind of file is this ?

§extension: String

Extension of the file. "" for a directory.

§kind_format: String

A formated filename where the “kind” of file (directory, char device, block devive, fifo, socket, normal) is prepend to the name, allowing a “sort by kind” method.

Implementations§

Reads every information about a file from its metadata and returs a new FileInfo object if we can create one.

Format the file line. Since files can have different owners in the same directory, we need to know the maximum size of owner column for formatting purpose.

Select the file.

Unselect the file.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Implement a selectable content for this struct. This trait allows to navigate through a vector of element content_type. It implements: is_empty, len, next, prev, selected. selected returns an optional reference to the value.

True if the content is empty.

The size of the content.

Select the prev item.

Select the next item.

Returns a reference to the selected content.

Returns the index of the selected item.

A reference to the content.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more