summary refs log tree commit diff
path: root/src/libstd/rt/rtio.rs
diff options
context:
space:
mode:
authorJeff Olson <olson.jeffery@gmail.com>2013-07-19 16:02:38 -0700
committerJeff Olson <olson.jeffery@gmail.com>2013-07-22 13:19:04 -0700
commit921d99108cd452f92569a0cafc8d11b36b38dfc0 (patch)
tree6ccfda26e363c9c74dcf50fc201ef4a8061a8848 /src/libstd/rt/rtio.rs
parent48f115e1681cdd5fa0d76400a3d23f7513286491 (diff)
downloadrust-921d99108cd452f92569a0cafc8d11b36b38dfc0.tar.gz
rust-921d99108cd452f92569a0cafc8d11b36b38dfc0.zip
std: add RtioTimer and UvTimer impl atop rt::uv
Diffstat (limited to 'src/libstd/rt/rtio.rs')
-rw-r--r--src/libstd/rt/rtio.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/rt/rtio.rs b/src/libstd/rt/rtio.rs
index 10eba85188e..aa8b9dc3a94 100644
--- a/src/libstd/rt/rtio.rs
+++ b/src/libstd/rt/rtio.rs
@@ -23,6 +23,7 @@ pub type IoFactoryObject = uvio::UvIoFactory;
 pub type RtioTcpStreamObject = uvio::UvTcpStream;
 pub type RtioTcpListenerObject = uvio::UvTcpListener;
 pub type RtioUdpSocketObject = uvio::UvUdpSocket;
+pub type RtioTimerObject = uvio::UvTimer;
 
 pub trait EventLoop {
     fn run(&mut self);
@@ -46,6 +47,7 @@ pub trait IoFactory {
     fn tcp_connect(&mut self, addr: IpAddr) -> Result<~RtioTcpStreamObject, IoError>;
     fn tcp_bind(&mut self, addr: IpAddr) -> Result<~RtioTcpListenerObject, IoError>;
     fn udp_bind(&mut self, addr: IpAddr) -> Result<~RtioUdpSocketObject, IoError>;
+    fn timer_init(&mut self) -> Result<~RtioTimerObject, IoError>;
 }
 
 pub trait RtioTcpListener : RtioSocket {
@@ -84,3 +86,7 @@ pub trait RtioUdpSocket : RtioSocket {
     fn hear_broadcasts(&mut self);
     fn ignore_broadcasts(&mut self);
 }
+
+pub trait RtioTimer {
+    fn sleep(&self, msecs: u64);
+}