about summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/fs.rs4
-rw-r--r--src/libstd/io/net/pipe.rs20
-rw-r--r--src/libstd/io/net/tcp.rs20
-rw-r--r--src/libstd/io/net/udp.rs7
-rw-r--r--src/libstd/io/pipe.rs4
5 files changed, 51 insertions, 4 deletions
diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs
index cd4141e045c..6d29f3d2538 100644
--- a/src/libstd/io/fs.rs
+++ b/src/libstd/io/fs.rs
@@ -88,8 +88,8 @@ pub struct File {
     last_nread: int,
 }
 
-impl sys_common::AsFileDesc for File {
-    fn as_fd(&self) -> &fs_imp::FileDesc {
+impl sys_common::AsInner<fs_imp::FileDesc> for File {
+    fn as_inner(&self) -> &fs_imp::FileDesc {
         &self.fd
     }
 }
diff --git a/src/libstd/io/net/pipe.rs b/src/libstd/io/net/pipe.rs
index 8e934d221d2..2984fa59631 100644
--- a/src/libstd/io/net/pipe.rs
+++ b/src/libstd/io/net/pipe.rs
@@ -33,6 +33,8 @@ use sys::pipe::UnixStream as UnixStreamImp;
 use sys::pipe::UnixListener as UnixListenerImp;
 use sys::pipe::UnixAcceptor as UnixAcceptorImp;
 
+use sys_common;
+
 /// A stream which communicates over a named pipe.
 pub struct UnixStream {
     inner: UnixStreamImp,
@@ -145,6 +147,12 @@ impl Writer for UnixStream {
     }
 }
 
+impl sys_common::AsInner<UnixStreamImp> for UnixStream {
+    fn as_inner(&self) -> &UnixStreamImp {
+        &self.inner
+    }
+}
+
 /// A value that can listen for incoming named pipe connection requests.
 pub struct UnixListener {
     /// The internal, opaque runtime Unix listener.
@@ -186,6 +194,12 @@ impl Listener<UnixStream, UnixAcceptor> for UnixListener {
     }
 }
 
+impl sys_common::AsInner<UnixListenerImp> for UnixListener {
+    fn as_inner(&self) -> &UnixListenerImp {
+        &self.inner
+    }
+}
+
 /// A value that can accept named pipe connections, returned from `listen()`.
 pub struct UnixAcceptor {
     /// The internal, opaque runtime Unix acceptor.
@@ -247,6 +261,12 @@ impl Clone for UnixAcceptor {
     }
 }
 
+impl sys_common::AsInner<UnixAcceptorImp> for UnixAcceptor {
+    fn as_inner(&self) -> &UnixAcceptorImp {
+        &self.inner
+    }
+}
+
 #[cfg(test)]
 #[allow(experimental)]
 mod tests {
diff --git a/src/libstd/io/net/tcp.rs b/src/libstd/io/net/tcp.rs
index cbac6b48b83..a989be758c3 100644
--- a/src/libstd/io/net/tcp.rs
+++ b/src/libstd/io/net/tcp.rs
@@ -31,6 +31,8 @@ use sys::tcp::TcpStream as TcpStreamImp;
 use sys::tcp::TcpListener as TcpListenerImp;
 use sys::tcp::TcpAcceptor as TcpAcceptorImp;
 
+use sys_common;
+
 /// A structure which represents a TCP stream between a local socket and a
 /// remote socket.
 ///
@@ -260,6 +262,12 @@ impl Writer for TcpStream {
     }
 }
 
+impl sys_common::AsInner<TcpStreamImp> for TcpStream {
+    fn as_inner(&self) -> &TcpStreamImp {
+        &self.inner
+    }
+}
+
 /// A structure representing a socket server. This listener is used to create a
 /// `TcpAcceptor` which can be used to accept sockets on a local port.
 ///
@@ -329,6 +337,12 @@ impl Listener<TcpStream, TcpAcceptor> for TcpListener {
     }
 }
 
+impl sys_common::AsInner<TcpListenerImp> for TcpListener {
+    fn as_inner(&self) -> &TcpListenerImp {
+        &self.inner
+    }
+}
+
 /// The accepting half of a TCP socket server. This structure is created through
 /// a `TcpListener`'s `listen` method, and this object can be used to accept new
 /// `TcpStream` instances.
@@ -456,6 +470,12 @@ impl Clone for TcpAcceptor {
     }
 }
 
+impl sys_common::AsInner<TcpAcceptorImp> for TcpAcceptor {
+    fn as_inner(&self) -> &TcpAcceptorImp {
+        &self.inner
+    }
+}
+
 #[cfg(test)]
 #[allow(experimental)]
 mod test {
diff --git a/src/libstd/io/net/udp.rs b/src/libstd/io/net/udp.rs
index 567e7da0c00..a7239ca0f2f 100644
--- a/src/libstd/io/net/udp.rs
+++ b/src/libstd/io/net/udp.rs
@@ -21,6 +21,7 @@ use io::{Reader, Writer, IoResult};
 use option::Option;
 use result::{Ok, Err};
 use sys::udp::UdpSocket as UdpSocketImp;
+use sys_common;
 
 /// A User Datagram Protocol socket.
 ///
@@ -184,6 +185,12 @@ impl Clone for UdpSocket {
     }
 }
 
+impl sys_common::AsInner<UdpSocketImp> for UdpSocket {
+    fn as_inner(&self) -> &UdpSocketImp {
+        &self.inner
+    }
+}
+
 /// A type that allows convenient usage of a UDP stream connected to one
 /// address via the `Reader` and `Writer` traits.
 ///
diff --git a/src/libstd/io/pipe.rs b/src/libstd/io/pipe.rs
index 8c20ea08863..41676cdf6e9 100644
--- a/src/libstd/io/pipe.rs
+++ b/src/libstd/io/pipe.rs
@@ -86,8 +86,8 @@ impl PipeStream {
     }
 }
 
-impl sys_common::AsFileDesc for PipeStream {
-    fn as_fd(&self) -> &sys::fs::FileDesc {
+impl sys_common::AsInner<sys::fs::FileDesc> for PipeStream {
+    fn as_inner(&self) -> &sys::fs::FileDesc {
         &*self.inner
     }
 }