about summary refs log tree commit diff
path: root/src/libstd/rt/uv/mod.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-07-27 01:49:35 -0700
committerbors <bors@rust-lang.org>2013-07-27 01:49:35 -0700
commit15310ba7c2a930a26bf6104f336cf7220eec7dc7 (patch)
treee85d3a47641c3a9f00364996647626f882501c1b /src/libstd/rt/uv/mod.rs
parentc5194740a78ec113cb6cbc937e7263e2548f62f6 (diff)
parentdf67942dccc33379051e66f075615e579f3bdb49 (diff)
auto merge of #8040 : luqmana/rust/rtn, r=brson
Implements various missing tcp & udp methods.. Also fixes handling ipv4-mapped/compatible ipv6 addresses and addresses the XXX on `status_to_maybe_uv_error`.

r? @brson 
Diffstat (limited to 'src/libstd/rt/uv/mod.rs')
-rw-r--r--src/libstd/rt/uv/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/rt/uv/mod.rs b/src/libstd/rt/uv/mod.rs
index 0eaf0dd3ab6..638d510614a 100644
--- a/src/libstd/rt/uv/mod.rs
+++ b/src/libstd/rt/uv/mod.rs
@@ -282,14 +282,14 @@ pub fn uv_error_to_io_error(uverr: UvError) -> IoError {
 }
 
 /// Given a uv handle, convert a callback status to a UvError
-// XXX: Follow the pattern below by parameterizing over T: Watcher, not T
-pub fn status_to_maybe_uv_error<T>(handle: *T, status: c_int) -> Option<UvError> {
+pub fn status_to_maybe_uv_error<T, U: Watcher + NativeHandle<*T>>(handle: U,
+                                                                 status: c_int) -> Option<UvError> {
     if status != -1 {
         None
     } else {
         unsafe {
-            rtdebug!("handle: %x", handle as uint);
-            let loop_ = uvll::get_loop_for_uv_handle(handle);
+            rtdebug!("handle: %x", handle.native_handle() as uint);
+            let loop_ = uvll::get_loop_for_uv_handle(handle.native_handle());
             rtdebug!("loop: %x", loop_ as uint);
             let err = uvll::last_error(loop_);
             Some(UvError(err))