pub trait MetadataExt {
Show 17 methods
// Required methods
fn as_raw_stat(&self) -> &stat;
fn st_dev(&self) -> u64;
fn st_ino(&self) -> u64;
fn st_mode(&self) -> u32;
fn st_nlink(&self) -> u64;
fn st_uid(&self) -> u32;
fn st_gid(&self) -> u32;
fn st_rdev(&self) -> u64;
fn st_size(&self) -> u64;
fn st_atime(&self) -> i64;
fn st_atime_nsec(&self) -> i64;
fn st_mtime(&self) -> i64;
fn st_mtime_nsec(&self) -> i64;
fn st_ctime(&self) -> i64;
fn st_ctime_nsec(&self) -> i64;
fn st_blksize(&self) -> u64;
fn st_blocks(&self) -> u64;
}Expand description
OS-specific extensions to fs::Metadata.
Required Methods§
1.1.0 · Sourcefn as_raw_stat(&self) -> &stat
👎Deprecated since 1.8.0: other methods of this trait are now preferred
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn as_raw_stat(&self) -> &stat
other methods of this trait are now preferred
1.8.0 · Sourcefn st_dev(&self) -> u64
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_dev(&self) -> u64
Returns the device ID on which this file resides.
§Examples
1.8.0 · Sourcefn st_ino(&self) -> u64
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_ino(&self) -> u64
Returns the inode number.
§Examples
1.8.0 · Sourcefn st_mode(&self) -> u32
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_mode(&self) -> u32
Returns the file type and mode.
§Examples
1.8.0 · Sourcefn st_nlink(&self) -> u64
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_nlink(&self) -> u64
Returns the number of hard links to file.
§Examples
1.8.0 · Sourcefn st_uid(&self) -> u32
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_uid(&self) -> u32
Returns the user ID of the file owner.
§Examples
1.8.0 · Sourcefn st_gid(&self) -> u32
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_gid(&self) -> u32
Returns the group ID of the file owner.
§Examples
1.8.0 · Sourcefn st_rdev(&self) -> u64
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_rdev(&self) -> u64
Returns the device ID that this file represents. Only relevant for special file.
§Examples
1.8.0 · Sourcefn st_size(&self) -> u64
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_size(&self) -> u64
Returns the size of the file (if it is a regular file or a symbolic link) in bytes.
The size of a symbolic link is the length of the pathname it contains, without a terminating null byte.
§Examples
1.8.0 · Sourcefn st_atime(&self) -> i64
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_atime(&self) -> i64
Returns the last access time of the file, in seconds since Unix Epoch.
§Examples
1.8.0 · Sourcefn st_atime_nsec(&self) -> i64
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_atime_nsec(&self) -> i64
1.8.0 · Sourcefn st_mtime(&self) -> i64
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_mtime(&self) -> i64
Returns the last modification time of the file, in seconds since Unix Epoch.
§Examples
1.8.0 · Sourcefn st_mtime_nsec(&self) -> i64
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_mtime_nsec(&self) -> i64
1.8.0 · Sourcefn st_ctime(&self) -> i64
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_ctime(&self) -> i64
Returns the last status change time of the file, in seconds since Unix Epoch.
§Examples
1.8.0 · Sourcefn st_ctime_nsec(&self) -> i64
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_ctime_nsec(&self) -> i64
1.8.0 · Sourcefn st_blksize(&self) -> u64
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).
fn st_blksize(&self) -> u64
Returns the “preferred” block size for efficient filesystem I/O.
§Examples
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".