[−][src]Struct async_std::fs::FileType
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
.
Methods
impl FileType
[src]
pub fn is_dir(&self) -> bool
[src]
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());
pub fn is_file(&self) -> bool
[src]
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());
pub fn is_symlink(&self) -> bool
[src]
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
impl Clone for FileType
[src]
impl Copy for FileType
[src]
impl Eq for FileType
[src]
impl PartialEq<FileType> for FileType
[src]
impl Debug for FileType
[src]
impl Hash for FileType
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl StructuralPartialEq for FileType
[src]
impl StructuralEq for FileType
[src]
Auto Trait Implementations
impl Send for FileType
impl Sync for FileType
impl Unpin for FileType
impl UnwindSafe for FileType
impl RefUnwindSafe for FileType
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,