Skip to content

Conversation

piegamesde
Copy link
Contributor

Closes #981.

  • The other methods delegate to async_io for the implementation. I suggest implementing it here right now until async_io adds the method too.
  • I used impl Stream<_> as return type instead of a custom IntoIncoming struct, because the code is cleaner (IMO) and also removes one level of pointer indirection. Also, this is what async_io does.

CC @yoshuawuyts

/// # Ok(()) }) }
/// ```
#[cfg(feature = "unstable")]
pub fn into_incoming(self) -> impl Stream<Item = io::Result<TcpStream>> + Send {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ideally would be a named future; but perhaps we can fix that in a follow-up PR?

@yoshuawuyts yoshuawuyts merged commit 4ee4beb into async-rs:master Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transform TcpListener into Stream of connections
3 participants