diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-01-08 19:37:25 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-01-08 22:02:35 -0800 |
| commit | 2db3abddcd6784dc5529081c6d831c972abbe755 (patch) | |
| tree | 0f18922234f5fce5fda2af3bdbd7ad4a03423ecd /src/libstd/net_tcp.rs | |
| parent | 3a5b64172045e7f1ec1981c8da2150c7feb73079 (diff) | |
| download | rust-2db3abddcd6784dc5529081c6d831c972abbe755.tar.gz rust-2db3abddcd6784dc5529081c6d831c972abbe755.zip | |
librustc: Make unqualified identifier searches terminate at the nearest module scope. r=tjc
Diffstat (limited to 'src/libstd/net_tcp.rs')
| -rw-r--r-- | src/libstd/net_tcp.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/libstd/net_tcp.rs b/src/libstd/net_tcp.rs index ca365e2a7d3..64e779fb996 100644 --- a/src/libstd/net_tcp.rs +++ b/src/libstd/net_tcp.rs @@ -24,6 +24,7 @@ use core::io; use core::libc::size_t; use core::libc; use core::oldcomm; +use core::prelude::*; use core::ptr; use core::result::{Result}; use core::result; @@ -86,7 +87,7 @@ pub type TcpErrData = { err_msg: ~str }; /// Details returned as part of a `result::err` result from `tcp::listen` -enum TcpListenErrData { +pub enum TcpListenErrData { /** * Some unplanned-for error. The first and second fields correspond * to libuv's `err_name` and `err_msg` fields, respectively. @@ -374,7 +375,7 @@ pub fn read_stop(sock: &TcpSocket, * * `timeout_msecs` - a `uint` value, in msecs, to wait before dropping the * read attempt. Pass `0u` to wait indefinitely */ -fn read(sock: &TcpSocket, timeout_msecs: uint) +pub fn read(sock: &TcpSocket, timeout_msecs: uint) -> result::Result<~[u8],TcpErrData> { let socket_data = ptr::addr_of(&(*(sock.socket_data))); read_common_impl(socket_data, timeout_msecs) @@ -1270,12 +1271,16 @@ type TcpBufferedSocketData = { //#[cfg(test)] mod test { - use net; use net::ip; + use net::tcp::{GenericListenErr, TcpConnectErrData, TcpListenErrData}; + use net::tcp::{TcpSocket, accept, connect, listen, read, socket_buf}; + use net; + use uv::iotask::IoTask; use uv; use core::io; use core::oldcomm; + use core::prelude::*; use core::result; use core::str; use core::task; |
