Struct async_std::fs::FileType [−][src]
pub struct FileType { /* fields omitted */ }
Expand description
The type of a file or directory.
A file type is returned by Metadata::file_type
.
Note that file types are mutually exclusive, i.e. at most one of methods is_dir
,
is_file
, and is_symlink
can return true
.
This type is a re-export of std::fs::FileType
.
Implementations
Returns true
if this file type represents a regular directory.
If this file type represents a symbolic link, this method returns false
.
Examples
use async_std::fs;
let file_type = fs::metadata(".").await?.file_type();
println!("{:?}", file_type.is_dir());
Returns true
if this file type represents a regular file.
If this file type represents a symbolic link, this method returns false
.
Examples
use async_std::fs;
let file_type = fs::metadata("a.txt").await?.file_type();
println!("{:?}", file_type.is_file());
Returns true
if this file type represents a symbolic link.
Examples
use async_std::fs;
let file_type = fs::metadata("a.txt").await?.file_type();
println!("{:?}", file_type.is_symlink());
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for FileType
impl UnwindSafe for FileType
Blanket Implementations
Mutably borrows from an owned value. Read more