diff options
| author | Vladimir Matveev <vladimir.matweev@gmail.com> | 2014-11-04 13:05:12 +0300 | 
|---|---|---|
| committer | Vladimir Matveev <vladimir.matweev@gmail.com> | 2014-11-05 12:01:24 +0300 | 
| commit | d1ec703329614af5e892605c47be08e7d0e15b8f (patch) | |
| tree | ea6b11a62d4def6a7ac363240a343fbb62452188 /src/libstd/io/net/tcp.rs | |
| parent | 7af0cb8af79ea6abd683c61d77e41b14a1242d23 (diff) | |
| download | rust-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.rs | 7 | 
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 })) } | 
