rustix::fs

Trait StatExt

Source
pub trait StatExt {
    // Required methods
    fn atime(&self) -> i64;
    fn mtime(&self) -> i64;
    fn ctime(&self) -> i64;
}
Available on crate feature fs only.
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§