From d1681bbde563dff88ad8f32592e7d373f62a038d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 12 Jan 2016 17:24:16 -0800 Subject: std: Expose SystemTime accessors on fs::Metadata These accessors are used to get at the last modification, last access, and creation time of the underlying file. Currently not all platforms provide the creation time, so that currently returns `Option`. --- src/libstd/time/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libstd/time') diff --git a/src/libstd/time/mod.rs b/src/libstd/time/mod.rs index f885733c2d1..a0cf443c0c3 100644 --- a/src/libstd/time/mod.rs +++ b/src/libstd/time/mod.rs @@ -16,6 +16,7 @@ use error::Error; use fmt; use ops::{Add, Sub}; use sys::time; +use sys_common::FromInner; #[stable(feature = "time", since = "1.3.0")] pub use self::duration::Duration; @@ -227,6 +228,12 @@ impl fmt::Display for SystemTimeError { } } +impl FromInner for SystemTime { + fn from_inner(time: time::SystemTime) -> SystemTime { + SystemTime(time) + } +} + #[cfg(test)] mod tests { use super::{Instant, SystemTime, Duration, UNIX_EPOCH}; -- cgit 1.4.1-3-g733a5