Enum fs_tree::FileTreeType
source · [−]Expand description
A filesystem tree recursive enum.
This enum has a variant for the following file types:
FileTreeType::Regular
- A regular file.FileTreeType::Directory
- A folder with a (possible empty) list of children.FileTreeType::Symlink
- A symbolic link that points to another path.
Variants
Regular
A regular file.
Directory(Vec<FileTree>)
A directory, might have children FileTree
s inside.
Symlink(PathBuf)
Symbolic link, and it’s target path.
The link might be broken, it’s not guaranteed that a symlink points to a valid path.
Implementations
sourceimpl FileTreeType
impl FileTreeType
sourcepub fn is_same_type_as(&self, other: &Self) -> bool
pub fn is_same_type_as(&self, other: &Self) -> bool
Checks if the FileTreeType is the same type as other.
sourcepub fn is_regular(&self) -> bool
pub fn is_regular(&self) -> bool
Shorthand for file.file_type.is_regular()
sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
Shorthand for file.file_type.is_symlink()
Trait Implementations
sourceimpl Clone for FileTreeType
impl Clone for FileTreeType
sourcefn clone(&self) -> FileTreeType
fn clone(&self) -> FileTreeType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FileTreeType
impl Debug for FileTreeType
sourceimpl Hash for FileTreeType
impl Hash for FileTreeType
sourceimpl Ord for FileTreeType
impl Ord for FileTreeType
sourcefn cmp(&self, other: &FileTreeType) -> Ordering
fn cmp(&self, other: &FileTreeType) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<FileTreeType> for FileTreeType
impl PartialEq<FileTreeType> for FileTreeType
sourcefn eq(&self, other: &FileTreeType) -> bool
fn eq(&self, other: &FileTreeType) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &FileTreeType) -> bool
fn ne(&self, other: &FileTreeType) -> bool
This method tests for !=
.
sourceimpl PartialOrd<FileTreeType> for FileTreeType
impl PartialOrd<FileTreeType> for FileTreeType
sourcefn partial_cmp(&self, other: &FileTreeType) -> Option<Ordering>
fn partial_cmp(&self, other: &FileTreeType) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for FileTreeType
impl StructuralEq for FileTreeType
impl StructuralPartialEq for FileTreeType
Auto Trait Implementations
impl RefUnwindSafe for FileTreeType
impl Send for FileTreeType
impl Sync for FileTreeType
impl Unpin for FileTreeType
impl UnwindSafe for FileTreeType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more