pub enum FileType {
File,
Directory,
Symlink,
}Expand description
Type of a filesystem entry.
Used in Metadata to indicate whether an entry is a file, directory,
or symbolic link.
Variants§
File
Regular file containing data.
Directory
Directory that can contain other entries.
Symlink
Symbolic link pointing to another path.
Implementations§
Source§impl FileType
impl FileType
Sourcepub fn is_file(&self) -> bool
pub fn is_file(&self) -> bool
Returns true if this is a regular file.
§Example
use bashkit::FileType;
assert!(FileType::File.is_file());
assert!(!FileType::Directory.is_file());Sourcepub fn is_dir(&self) -> bool
pub fn is_dir(&self) -> bool
Returns true if this is a directory.
§Example
use bashkit::FileType;
assert!(FileType::Directory.is_dir());
assert!(!FileType::File.is_dir());Sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
Returns true if this is a symbolic link.
§Example
use bashkit::FileType;
assert!(FileType::Symlink.is_symlink());
assert!(!FileType::File.is_symlink());Trait Implementations§
impl Copy for FileType
impl StructuralPartialEq for FileType
Auto Trait Implementations§
impl Freeze for FileType
impl RefUnwindSafe for FileType
impl Send for FileType
impl Sync for FileType
impl Unpin for FileType
impl UnwindSafe for FileType
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
Mutably borrows from an owned value. Read more