Rollup merge of #68150 - tillarnold:master, r=cramertj

Document behavior of set_nonblocking on UnixListener

The description on `set_nonblocking` in `UnixListener` was rather brief so I adapted it to be more like the documentation of  `set_nonblocking` in `TcpListener`.
This commit is contained in:
Yuki Okushi 2020-01-14 14:02:24 +09:00 committed by GitHub
commit 725f88b09c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -902,6 +902,12 @@ impl UnixListener {
/// Moves the socket into or out of nonblocking mode.
///
/// This will result in the `accept` operation becoming nonblocking,
/// i.e., immediately returning from their calls. If the IO operation is
/// successful, `Ok` is returned and no further action is required. If the
/// IO operation could not be completed and needs to be retried, an error
/// with kind [`io::ErrorKind::WouldBlock`] is returned.
///
/// # Examples
///
/// ```no_run
@ -913,6 +919,8 @@ impl UnixListener {
/// Ok(())
/// }
/// ```
///
/// [`io::ErrorKind::WouldBlock`]: ../../../io/enum.ErrorKind.html#variant.WouldBlock
#[stable(feature = "unix_socket", since = "1.10.0")]
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
self.0.set_nonblocking(nonblocking)