Skip to content

Add TcpListener::into_incoming #995

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2021
Merged

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