diff options
author | Akshay Narayan <akshayn@mit.edu> | 2020-02-26 15:16:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 21:16:13 +0100 |
commit | d44ce338af6ef3cf666f5b3db6e8e0bf057e5490 (patch) | |
tree | 321015f84fd6a5c922468f26197fee76612791f5 /tokio/src/net/unix | |
parent | 8b7ea0ff5cad2522d3113b77e9b6d95b507dee3b (diff) |
tcp: Update listener docs (#2276)
* Update listener docs
* re-wrap text and add links
Diffstat (limited to 'tokio/src/net/unix')
-rw-r--r-- | tokio/src/net/unix/listener.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tokio/src/net/unix/listener.rs b/tokio/src/net/unix/listener.rs index 0e7affc2..5acc1b7e 100644 --- a/tokio/src/net/unix/listener.rs +++ b/tokio/src/net/unix/listener.rs @@ -15,10 +15,10 @@ use std::task::{Context, Poll}; cfg_uds! { /// A Unix socket which can accept connections from other Unix sockets. /// - /// Also implements a stream over the connections being received on this listener. - /// - /// The stream will never return `None` and will also not yield the peer's - /// `SocketAddr` structure. Iterating over it is equivalent to calling accept in a loop. + /// You can accept a new connection by using the [`accept`](`UnixListener::accept`) method. Alternatively `UnixListener` + /// implements the [`Stream`](`crate::stream::Stream`) trait, which allows you to use the listener in places that want a + /// stream. The stream will never return `None` and will also not yield the peer's `SocketAddr` structure. Iterating over + /// it is equivalent to calling accept in a loop. /// /// # Errors /// @@ -137,6 +137,8 @@ impl UnixListener { /// Returns a stream over the connections being received on this listener. /// + /// Note that `UnixListener` also directly implements `Stream`. + /// /// The returned stream will never return `None` and will also not yield the /// peer's `SocketAddr` structure. Iterating over it is equivalent to /// calling accept in a loop. |