diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-17 12:13:29 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-24 14:21:57 -0700 |
| commit | 4ce71eaca34526d0e3ee1ebf0658d2a20d388ef2 (patch) | |
| tree | 440d109c6f23dd446573195828c1ebbf2d261994 /src/libstd/rt/rtio.rs | |
| parent | 59d45b8fe793d369ddf600cce0f212f9b6165a30 (diff) | |
Migrate the last typedefs to ~Trait in rtio
There are no longer any remnants of typedefs, and everything is now built on true trait objects.
Diffstat (limited to 'src/libstd/rt/rtio.rs')
| -rw-r--r-- | src/libstd/rt/rtio.rs | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/libstd/rt/rtio.rs b/src/libstd/rt/rtio.rs index 924d9c4bff1..c779be01046 100644 --- a/src/libstd/rt/rtio.rs +++ b/src/libstd/rt/rtio.rs @@ -18,15 +18,10 @@ use ai = rt::io::net::addrinfo; use rt::io::IoError; use super::io::process::ProcessConfig; use super::io::net::ip::{IpAddr, SocketAddr}; -use rt::uv::uvio; use path::Path; use super::io::{SeekStyle}; use super::io::{FileMode, FileAccess, FileStat}; -// FIXME(#9893) cannot call by-value self method on a trait object -pub type RtioTcpListenerObject = uvio::UvTcpListener; -pub type RtioUnixListenerObject = uvio::UvUnixListener; - pub trait EventLoop { fn run(&mut self); fn callback(&mut self, ~fn()); @@ -82,7 +77,7 @@ pub fn with_local_io<T>(f: &fn(&mut IoFactory) -> Option<T>) -> Option<T> { pub trait IoFactory { fn tcp_connect(&mut self, addr: SocketAddr) -> Result<~RtioTcpStream, IoError>; - fn tcp_bind(&mut self, addr: SocketAddr) -> Result<~RtioTcpListenerObject, IoError>; + fn tcp_bind(&mut self, addr: SocketAddr) -> Result<~RtioTcpListener, IoError>; fn udp_bind(&mut self, addr: SocketAddr) -> Result<~RtioUdpSocket, IoError>; fn get_host_addresses(&mut self, host: Option<&str>, servname: Option<&str>, hint: Option<ai::Hint>) -> Result<~[ai::Info], IoError>; @@ -100,14 +95,14 @@ pub trait IoFactory { -> Result<(~RtioProcess, ~[Option<~RtioPipe>]), IoError>; fn unix_bind(&mut self, path: &CString) -> - Result<~RtioUnixListenerObject, IoError>; + Result<~RtioUnixListener, IoError>; fn unix_connect(&mut self, path: &CString) -> Result<~RtioPipe, IoError>; fn tty_open(&mut self, fd: c_int, readable: bool, close_on_drop: bool) -> Result<~RtioTTY, IoError>; } pub trait RtioTcpListener : RtioSocket { - fn listen(self) -> Result<~RtioTcpAcceptor, IoError>; + fn listen(~self) -> Result<~RtioTcpAcceptor, IoError>; } pub trait RtioTcpAcceptor : RtioSocket { @@ -173,7 +168,7 @@ pub trait RtioPipe { } pub trait RtioUnixListener { - fn listen(self) -> Result<~RtioUnixAcceptor, IoError>; + fn listen(~self) -> Result<~RtioUnixAcceptor, IoError>; } pub trait RtioUnixAcceptor { |
