diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2016-01-12 17:24:16 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2016-02-04 13:15:28 -0800 |
| commit | d1681bbde563dff88ad8f32592e7d373f62a038d (patch) | |
| tree | d469ea15d1a724ff7295c7e5917ca3f154206e34 /src/libstd/time | |
| parent | d0ef74026690cffccb543fc274d73a078eba797d (diff) | |
| download | rust-d1681bbde563dff88ad8f32592e7d373f62a038d.tar.gz rust-d1681bbde563dff88ad8f32592e7d373f62a038d.zip | |
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`.
Diffstat (limited to 'src/libstd/time')
| -rw-r--r-- | src/libstd/time/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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<time::SystemTime> for SystemTime { + fn from_inner(time: time::SystemTime) -> SystemTime { + SystemTime(time) + } +} + #[cfg(test)] mod tests { use super::{Instant, SystemTime, Duration, UNIX_EPOCH}; |
