devela::_dep::rustix::fs

Trait StatExt

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

fn atime(&self) -> i64

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

fn mtime(&self) -> i64

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

fn ctime(&self) -> i64

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

Implementations on Foreign Types§

§

impl StatExt for stat

§

fn atime(&self) -> i64

§

fn mtime(&self) -> i64

§

fn ctime(&self) -> i64

Implementors§