pub struct FolderEntry {
pub name: String,
pub folder: bool,
}Expand description
One entry of a folder, as a file manager reads it: a name and whether it can be opened.
A tree row shows nothing else, so nothing else is read. Size, date and permissions each mean another call to the system for every entry, which a folder of ten thousand entries cannot afford, so they belong to the views that show them.
Fields§
§name: StringIts name, without any folder before it.
folder: boolWhether it is a folder, and so can be opened. A symbolic link is never a folder: opening one would leave the tree it is drawn in.
Implementations§
Source§impl FolderEntry
impl FolderEntry
Whether the entry is one the platform hides: on every system the framework runs on, a name that starts with a dot.
Sourcepub fn read_folder(path: &Path) -> Result<Vec<Self>, String>
pub fn read_folder(path: &Path) -> Result<Vec<Self>, String>
Reads one folder, folders first and then files, each group in name order.
This touches the disk, so it belongs on a background thread; FileManagerState asks for
it with Command::perform and never while drawing.
§Errors
What the operating system said, when the folder cannot be read. The manager’s own reads say
it in the person’s language instead; see FileManagerMsg::Listed.
Trait Implementations§
Source§impl Clone for FolderEntry
impl Clone for FolderEntry
Source§fn clone(&self) -> FolderEntry
fn clone(&self) -> FolderEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FolderEntry
impl Debug for FolderEntry
impl Eq for FolderEntry
Source§impl Ord for FolderEntry
impl Ord for FolderEntry
Source§fn cmp(&self, other: &FolderEntry) -> Ordering
fn cmp(&self, other: &FolderEntry) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for FolderEntry
impl PartialEq for FolderEntry
Source§impl PartialOrd for FolderEntry
impl PartialOrd for FolderEntry
impl StructuralPartialEq for FolderEntry
Auto Trait Implementations§
impl Freeze for FolderEntry
impl RefUnwindSafe for FolderEntry
impl Send for FolderEntry
impl Sync for FolderEntry
impl Unpin for FolderEntry
impl UnsafeUnpin for FolderEntry
impl UnwindSafe for FolderEntry
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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