Trait rustix::fs::StatExt

source ·
pub trait StatExt {
    // Required methods
    fn atime(&self) -> i64;
    fn mtime(&self) -> i64;
    fn ctime(&self) -> i64;
}
Expand description

Extension trait for accessing timestamp fields of Stat.

Rustix’s Stat type on some platforms has unsigned st_mtime, st_atime, and st_ctime fields. This is incorrect, as Unix defines these fields to be signed, with negative values representing dates before the Unix epoch. Until the next semver bump, these unsigned fields are deprecated, and this trait provides accessors which return their values as signed integers.

Required Methods§

source

fn atime(&self) -> i64

Return the value of the st_atime field, casted to the correct type.

source

fn mtime(&self) -> i64

Return the value of the st_mtime field, casted to the correct type.

source

fn ctime(&self) -> i64

Return the value of the st_ctime field, casted to the correct type.

Implementors§