about summary refs log tree commit diff
path: root/src/libstd/io/net/tcp.rs
diff options
context:
space:
mode:
authorVladimir Matveev <vladimir.matweev@gmail.com>2014-11-04 13:05:12 +0300
committerVladimir Matveev <vladimir.matweev@gmail.com>2014-11-05 12:01:24 +0300
commitd1ec703329614af5e892605c47be08e7d0e15b8f (patch)
treeea6b11a62d4def6a7ac363240a343fbb62452188 /src/libstd/io/net/tcp.rs
parent7af0cb8af79ea6abd683c61d77e41b14a1242d23 (diff)
downloadrust-d1ec703329614af5e892605c47be08e7d0e15b8f.tar.gz
rust-d1ec703329614af5e892605c47be08e7d0e15b8f.zip
Added more documentation on ToSocketAddr trait
Diffstat (limited to 'src/libstd/io/net/tcp.rs')
-rw-r--r--src/libstd/io/net/tcp.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstd/io/net/tcp.rs b/src/libstd/io/net/tcp.rs
index 6fb31d52dab..928c8586739 100644
--- a/src/libstd/io/net/tcp.rs
+++ b/src/libstd/io/net/tcp.rs
@@ -74,8 +74,8 @@ impl TcpStream {
     /// specified elapses before a connection is made an error will be
     /// returned. The error's kind will be `TimedOut`.
     ///
-    /// Same as the `connect` method, `addr` argument type can vary as defined
-    /// by `ToSocketAddr` trait.
+    /// Same as the `connect` method, `addr` argument type can be anything which
+    /// implements `ToSocketAddr` trait.
     ///
     /// If a `timeout` with zero or negative duration is specified then
     /// the function returns `Err`, with the error kind set to `TimedOut`.
@@ -320,6 +320,9 @@ impl TcpListener {
     /// Binding with a port number of 0 will request that the OS assigns a port
     /// to this listener. The port allocated can be queried via the
     /// `socket_name` function.
+    ///
+    /// The address type can be any implementor of `ToSocketAddr` trait. See its
+    /// documentation for concrete examples.
     pub fn bind<A: ToSocketAddr>(addr: A) -> IoResult<TcpListener> {
         super::with_addresses_io(addr, |io, addr| io.tcp_bind(addr).map(|l| TcpListener { obj: l }))
     }