pub struct DirectoryEntry {
path: PathBuf,
metadata: Metadata,
is_directory: bool,
is_system_file: bool,
is_hidden: bool,
icon: String,
pub selected: bool,
}
Expand description
Contains the information of a directory item.
This struct is mainly there so that the information and metadata can be loaded once and not that
a request has to be sent to the OS every frame using, for example, path.is_file()
.
Fields§
§path: PathBuf
§metadata: Metadata
§is_directory: bool
§is_system_file: bool
§icon: String
§selected: bool
If the item is marked as selected as part of a multi selection.
Implementations§
Source§impl DirectoryEntry
impl DirectoryEntry
Sourcepub fn from_path(
config: &FileDialogConfig,
path: &Path,
file_system: &dyn FileSystem,
) -> Self
pub fn from_path( config: &FileDialogConfig, path: &Path, file_system: &dyn FileSystem, ) -> Self
Creates a new directory entry from a path
Sourcepub fn path_eq(&self, other: &Self) -> bool
pub fn path_eq(&self, other: &Self) -> bool
Checks if the path of the current directory entry matches the other directory entry.
Sourcepub const fn is_dir(&self) -> bool
pub const fn is_dir(&self) -> bool
Returns true if the item is a directory.
False is returned if the item is a file or the path did not exist when the
DirectoryEntry
object was created.
Sourcepub const fn is_file(&self) -> bool
pub const fn is_file(&self) -> bool
Returns true if the item is a file.
False is returned if the item is a directory or the path did not exist when the
DirectoryEntry
object was created.
Sourcepub const fn is_system_file(&self) -> bool
pub const fn is_system_file(&self) -> bool
Returns true if the item is a system file.
Sourcepub fn to_path_buf(&self) -> PathBuf
pub fn to_path_buf(&self) -> PathBuf
Clones the path of the directory item.
Returns whether the path this DirectoryEntry
points to is considered hidden.
Trait Implementations§
Source§impl Clone for DirectoryEntry
impl Clone for DirectoryEntry
Source§fn clone(&self) -> DirectoryEntry
fn clone(&self) -> DirectoryEntry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more