5
0
mirror of git://git.proxmox.com/git/pxar.git synced 2025-02-03 21:47:00 +03:00

convenience method to get mtime as std Duration

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2020-03-23 14:26:21 +01:00
parent 8eb622dd0e
commit 6da548dd11

View File

@ -156,6 +156,14 @@ impl Entry {
}
}
/// Convenience accessor methods.
impl Entry {
/// Get the mtime as duration since the epoch.
pub fn mtime_as_duration(&self) -> std::time::Duration {
std::time::Duration::from_nanos(self.mtime)
}
}
/// Convenience methods.
impl Entry {
/// Check whether this is a directory.