Struct fm::status::Status

source ·
pub struct Status {
    pub tabs: [Tab; 2],
    pub index: usize,
    pub flagged: Flagged,
    pub marks: Marks,
    pub colors: ColorCache,
    pub dual_pane: bool,
    pub system_info: System,
    pub display_full: bool,
    pub opener: Opener,
    pub help: String,
    pub trash: Trash,
    /* private fields */
}
Expand description

Holds every mutable parameter of the application itself, except for the “display” information. It holds 2 tabs (left & right), even if only one can be displayed sometimes. It knows which tab is selected, which files are flagged, which jump target is selected, a cache of normal file colors, if we have to display one or two tabs and if all details are shown or only the filename. Mutation of this struct are mostly done externally, by the event crate : crate::event_exec.

Fields§

§tabs: [Tab; 2]

Vector of Tab, each of them are displayed in a separate tab.

§index: usize

Index of the current selected tab

§flagged: Flagged

The flagged files

§marks: Marks

Marks allows you to jump to a save mark

§colors: ColorCache

Colors for extension

§dual_pane: bool

do we display one or two tabs ?

§system_info: System§display_full: bool

do we display all info or only the filenames ?

§opener: Opener

The opener used by the application.

§help: String

The help string.

§trash: Trash

The trash

Implementations§

Max valid permission number, ie 0o777.

Creates a new status for the application. It requires most of the information (arguments, configuration, height of the terminal, the formated help string).

Select the other tab if two are displayed. Does nother otherwise.

Select the other tab if two are displayed. Does nother otherwise.

Returns a mutable reference to the selected tab.

Returns a non mutable reference to the selected tab.

Reset the view of every tab.

Toggle the flagged attribute of a path.

Replace the tab content with what was returned by skim. It calls skim read its output, then replace the tab itself.

Returns a vector of path of files which are both flagged and in current directory. It’s necessary since the user may have flagged files OUTSIDE of current directory before calling Bulkrename. It may be confusing since the same filename can be used in different places.

Execute a move or a copy of the flagged files to current directory. A progress bar is displayed (invisible for small files) and a notification is sent every time, even for 0 bytes files…

Empty the flagged files, reset the view of every tab.

Set the permissions of the flagged files according to a given permission. If the permission are invalid or if the user can’t edit them, it may fail.

Flag every file matching a typed regex.

Select a tab according to its index. It’s deprecated and is left mostly because I’m not sure I want tabs & panes… and I haven’t fully decided yet. Since I’m lazy and don’t want to write it twice, it’s left here.

Set dual pane mode to true or false.

Refresh every disk information. It also refreshes the disk list, which is usefull to detect removable medias. It may be very slow… There’s surelly a better way, like doing it only once in a while or on demand.

Returns an array of Disks

Returns a pair of disk spaces for both tab.

Returns the mount points of every disk.

Returns the sice of the terminal (width, height)

Returns a string representing the current path in the selected tab.

Refresh the existing users.

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 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