Trait fmmap::MetaDataExt
source · [−]pub trait MetaDataExt {
Show 22 methods
fn accessed(&self) -> Result<SystemTime, Error>;
fn created(&self) -> Result<SystemTime, Error>;
fn is_file(&self) -> bool;
fn is_symlink(&self) -> bool;
fn len(&self) -> u64;
fn modified(&self) -> Result<SystemTime, Error>;
fn dev(&self) -> u64;
fn ino(&self) -> u64;
fn mode(&self) -> u32;
fn nlink(&self) -> u64;
fn uid(&self) -> u32;
fn gid(&self) -> u32;
fn rdev(&self) -> u64;
fn size(&self) -> u64;
fn atime(&self) -> i64;
fn atime_nsec(&self) -> i64;
fn mtime(&self) -> i64;
fn mtime_nsec(&self) -> i64;
fn ctime(&self) -> i64;
fn ctime_nsec(&self) -> i64;
fn blksize(&self) -> u64;
fn blocks(&self) -> u64;
}Expand description
Utility methods to MetaData
Required Methods
fn accessed(&self) -> Result<SystemTime, Error>
fn accessed(&self) -> Result<SystemTime, Error>
Returns the last access time of this metadata.
The returned value corresponds to the atime field of stat on Unix platforms and the ftLastAccessTime field on Windows platforms.
Note that not all platforms will keep this field update in a file’s metadata, for example Windows has an option to disable updating this time when files are accessed and Linux similarly has noatime.
fn created(&self) -> Result<SystemTime, Error>
fn created(&self) -> Result<SystemTime, Error>
Returns the creation time listed in this metadata.
The returned value corresponds to the btime field of statx on Linux kernel starting from to 4.11,
the birthtime field of stat on other Unix platforms,
and the ftCreationTime field on Windows platforms.
Returns true if this metadata is for a regular file.
It will be false for symlink metadata obtained from symlink_metadata.
When the goal is simply to read from (or write to) the source, the most reliable way to test the source can be read (or written to) is to open it. Only using is_file can break workflows like diff <( prog_a ) on a Unix-like system for example.
fn is_symlink(&self) -> bool
fn is_symlink(&self) -> bool
nightly only.Returns true if this metadata is for a symbolic link.
fn modified(&self) -> Result<SystemTime, Error>
fn modified(&self) -> Result<SystemTime, Error>
Returns the last modification time listed in this metadata.
The returned value corresponds to the mtime field of stat on Unix platforms
and the ftLastWriteTime field on Windows platforms.
Errors
This field might not be available on all platforms, and
will return an Err on platforms where it is not available.
fn atime_nsec(&self) -> i64
fn atime_nsec(&self) -> i64
Returns the last access time of the file, in nanoseconds since atime.
Returns the last modification time of the file, in seconds since Unix Epoch.
fn mtime_nsec(&self) -> i64
fn mtime_nsec(&self) -> i64
Returns the last modification time of the file, in nanoseconds since mtime.
Returns the last status change time of the file, in seconds since Unix Epoch.
fn ctime_nsec(&self) -> i64
fn ctime_nsec(&self) -> i64
Returns the last status change time of the file, in nanoseconds since ctime.