[−][src]Struct async_std::fs::Metadata
Metadata for a file or directory.
Metadata is returned by metadata
and symlink_metadata
.
This type is a re-export of std::fs::Metadata
.
Methods
impl Metadata
[src]
pub fn file_type(&self) -> FileType
[src]
Returns the file type from this metadata.
Examples
use async_std::fs; let metadata = fs::metadata("a.txt").await?; println!("{:?}", metadata.file_type());
pub fn is_dir(&self) -> bool
[src]
Returns true
if this metadata is for a regular directory.
If this metadata is for a symbolic link, this method returns false
.
Examples
use async_std::fs; let metadata = fs::metadata(".").await?; println!("{:?}", metadata.is_dir());
pub fn is_file(&self) -> bool
[src]
Returns true
if this metadata is for a regular file.
If this metadata is for a symbolic link, this method returns false
.
Examples
use async_std::fs; let metadata = fs::metadata("a.txt").await?; println!("{:?}", metadata.is_file());
pub fn len(&self) -> u64
[src]
Returns the file size in bytes.
Examples
use async_std::fs; let metadata = fs::metadata("a.txt").await?; println!("{}", metadata.len());
pub fn permissions(&self) -> Permissions
[src]
Returns the permissions from this metadata.
Examples
use async_std::fs; let metadata = fs::metadata("a.txt").await?; println!("{:?}", metadata.permissions());
pub fn modified(&self) -> Result<SystemTime>
[src]
Returns the last modification time.
Errors
This data may not be available on all platforms, in which case an error will be returned.
Examples
use async_std::fs; let metadata = fs::metadata("a.txt").await?; println!("{:?}", metadata.modified());
pub fn accessed(&self) -> Result<SystemTime>
[src]
Returns the last access time.
Errors
This data may not be available on all platforms, in which case an error will be returned.
Examples
use async_std::fs; let metadata = fs::metadata("a.txt").await?; println!("{:?}", metadata.accessed());
pub fn created(&self) -> Result<SystemTime>
[src]
Trait Implementations
Auto Trait Implementations
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
impl RefUnwindSafe for Metadata
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,