pub struct FileType(/* private fields */);
Expand description
A structure representing a type of file with accessors for each file type.
This corresponds to std::fs::FileType
.
We need to define our own version because the libstd `FileType` doesn't
have a public constructor that we can use.
Implementations§
Source§impl FileType
impl FileType
Sourcepub fn is_dir(&self) -> bool
pub fn is_dir(&self) -> bool
Tests whether this file type represents a directory.
This corresponds to std::fs::FileType::is_dir
.
Sourcepub fn is_file(&self) -> bool
pub fn is_file(&self) -> bool
Tests whether this file type represents a regular file.
This corresponds to std::fs::FileType::is_file
.
Sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
Tests whether this file type represents a symbolic link.
This corresponds to std::fs::FileType::is_symlink
.
Trait Implementations§
Source§impl FileTypeExt for FileType
impl FileTypeExt for FileType
Source§fn is_symlink_dir(&self) -> bool
fn is_symlink_dir(&self) -> bool
Returns
true
if this file type is a symbolic link that is also a
directory.Source§fn is_symlink_file(&self) -> bool
fn is_symlink_file(&self) -> bool
Returns
true
if this file type is a symbolic link that is also a
file.impl Copy for FileType
impl Eq 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)