diff options
author | kalcutter <kal.conley@dectris.com> | 2020-09-23 16:21:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-23 16:21:18 +0200 |
commit | 3114d9e826e5aa1948d394a7d6d488f61ab1da97 (patch) | |
tree | 60d21e1aee27ad03ca9b360a8473b8e06f810315 /tokio/src/net/unix/listener.rs | |
parent | 5467f0a573c915d9c1a8c032803109b495784b29 (diff) |
net: change `UnixListener::poll_accept` to public (#2845)
Diffstat (limited to 'tokio/src/net/unix/listener.rs')
-rw-r--r-- | tokio/src/net/unix/listener.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tokio/src/net/unix/listener.rs b/tokio/src/net/unix/listener.rs index 119dc6fb..fc3c8710 100644 --- a/tokio/src/net/unix/listener.rs +++ b/tokio/src/net/unix/listener.rs @@ -104,7 +104,11 @@ impl UnixListener { poll_fn(|cx| self.poll_accept(cx)).await } - pub(crate) fn poll_accept( + /// Polls to accept a new incoming connection to this listener. + /// + /// If there is no connection to accept, `Poll::Pending` is returned and + /// the current task will be notified by a waker. + pub fn poll_accept( &mut self, cx: &mut Context<'_>, ) -> Poll<io::Result<(UnixStream, SocketAddr)>> { |