summaryrefslogtreecommitdiff
path: root/src/sys/time.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/time.rs')
-rw-r--r--src/sys/time.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sys/time.rs b/src/sys/time.rs
index 9048a3ab..0d977045 100644
--- a/src/sys/time.rs
+++ b/src/sys/time.rs
@@ -59,6 +59,12 @@ const TS_MAX_SECONDS: i64 = ::std::isize::MAX as i64;
const TS_MIN_SECONDS: i64 = -TS_MAX_SECONDS;
+impl AsRef<timespec> for TimeSpec {
+ fn as_ref(&self) -> &timespec {
+ &self.0
+ }
+}
+
impl fmt::Debug for TimeSpec {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_struct("TimeSpec")
@@ -264,6 +270,12 @@ const TV_MAX_SECONDS: i64 = ::std::isize::MAX as i64;
const TV_MIN_SECONDS: i64 = -TV_MAX_SECONDS;
+impl AsRef<timeval> for TimeVal {
+ fn as_ref(&self) -> &timeval {
+ &self.0
+ }
+}
+
impl fmt::Debug for TimeVal {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_struct("TimeVal")