Skip to main content

FileManagerMsg

Enum FileManagerMsg 

Source
#[non_exhaustive]
pub enum FileManagerMsg {
Show 29 variants Select(String), Choose(Vec<String>), Expand(String, bool), Read(String, Result<Vec<FolderEntry>, String>), Listed(String, Result<Vec<FolderEntry>, FileError>), NewFile(String), NewFolder(String), Rename(String), Cut(String), Copy(String), Paste(String), DropCut, Drop(TreeDrop), Delete(String), DeleteConfirmed(Vec<String>), Trash(String), ShowHidden(bool), Work(TaskEvent), Stop, Refresh, Name(String), Submit, CloseNaming, Done(Vec<(String, Result<FileChange, FileError>)>), Changed(u64, Vec<FolderChange>), Detail(Vec<String>), Detailed(Vec<(String, Option<FileDetails>)>), Enter(String), Leave,
}
Expand description

Something that happened in a FileManager.

Hand every one of these to FileManagerState::update; the application’s own messages come from FileManager::on_open and the items it adds to the menu, never from here.

More things may happen as the manager grows, so match with a _ arm; an application normally hands every one of these straight over without looking.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Select(String)

The cursor moved to this key.

§

Choose(Vec<String>)

The entries of these keys became the selection.

§

Expand(String, bool)

The folder of this key was opened, or closed when false.

§

Read(String, Result<Vec<FolderEntry>, String>)

The folder of this key was read in the background, or could not be, by the application’s own reading. The text is the system’s own; hand it over as it comes.

§

Listed(String, Result<Vec<FolderEntry>, FileError>)

The folder of this key was read by the manager itself.

Why a read failed is kept as a FileError rather than as words, because the thread that read the folder does not know the person’s language; the words are chosen here.

§

NewFile(String)

A new file was asked for in the folder of this key.

§

NewFolder(String)

A new folder was asked for in the folder of this key.

§

Rename(String)

The entry of this key was asked to take another name.

§

Cut(String)

The entry of this key was cut, with the rest of the selection when it is part of it, to be pasted into another folder.

§

Copy(String)

The entry of this key was copied, with the rest of the selection when it is part of it, to be pasted into another folder. What was copied stays where it is.

§

Paste(String)

What was cut was asked to go into the folder of this key.

§

DropCut

What was cut is to stay where it is after all.

§

Drop(TreeDrop)

Entries were dragged onto a folder, or onto the free space that stands for the root.

§

Delete(String)

The entry of this key was asked to be deleted, with the rest of the selection when it is part of it; the person is asked first.

§

DeleteConfirmed(Vec<String>)

The person said yes to deleting the entries of these keys.

§

Trash(String)

The entry of this key was asked to go to the trash, with the rest of the selection when it is part of it. Nothing is asked: the trash can be looked in again.

§

ShowHidden(bool)

Hidden entries are shown from now on, or hidden again when false.

§

Work(TaskEvent)

The long operation running now started, came further along or ended.

§

Stop

The long operation running now was asked to stop.

§

Refresh

Every open folder was asked to be read again.

§

Name(String)

The name in the dialog changed.

§

Submit

The name in the dialog was confirmed.

§

CloseNaming

The dialog was closed without a name.

§

Done(Vec<(String, Result<FileChange, FileError>)>)

Operations finished or were refused: for each entry its key and what came of it.

§

Changed(u64, Vec<FolderChange>)

A batch of outside changes of the watch u64 arrived; empty once that watch was let go.

§

Detail(Vec<String>)

The details of the entries of these keys were asked for: their size, when they changed and their permissions. Keys that are already known, or already on their way, cost nothing.

§

Detailed(Vec<(String, Option<FileDetails>)>)

The details of these keys were read, None for an entry the system said nothing about.

§

Enter(String)

A flat view stepped into the folder of this key; it is read if it has not been.

§

Leave

A flat view stepped out of the folder it shows, into the one above it.

Trait Implementations§

Source§

impl Clone for FileManagerMsg

Source§

fn clone(&self) -> FileManagerMsg

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 FileManagerMsg

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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