Skip to content

Commit

Permalink
Change UnixListener::poll_accept to public
Browse files Browse the repository at this point in the history
This makes it consistent with `TcpListener::poll_accept` and other
public poll methods the library provides. This particular method is
useful for writing generic code that accepts connections since async
functions can't easily be used with traits. It is possible to
generically accept connections with `Incoming`, however, this doesn't
return the incoming `SocketAddr`.
  • Loading branch information
kalcutter committed Sep 19, 2020
1 parent 207320d commit e1b37c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tokio/src/net/unix/listener.rs
Expand Up @@ -104,7 +104,8 @@ impl UnixListener {
poll_fn(|cx| self.poll_accept(cx)).await
}

pub(crate) fn poll_accept(
#[doc(hidden)]
pub fn poll_accept(
&mut self,
cx: &mut Context<'_>,
) -> Poll<io::Result<(UnixStream, SocketAddr)>> {
Expand Down

0 comments on commit e1b37c2

Please sign in to comment.