Skip to content
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

Tracking Issue for tcplistener_into_incoming #88373

Open
1 of 3 tasks
piegamesde opened this issue Aug 26, 2021 · 0 comments
Open
1 of 3 tasks

Tracking Issue for tcplistener_into_incoming #88373

piegamesde opened this issue Aug 26, 2021 · 0 comments
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@piegamesde
Copy link
Contributor

Feature gate: #![feature(tcplistener_into_incoming)]

This is a tracking issue for #88339

The TcpListener::incoming method is really useful, however for some use cases the borrow it introduces is needlessly restricting. Thus, an owned variant is added.

Public API

// std::net

pub struct IntoIncoming;

impl Iterator<Item = io::Result<TcpStream>> for IntoIncoming;

impl TcpListener {
    pub fn into_incoming(self) -> IntoIncoming;
}

Steps / History

Unresolved Questions

  • The IntoIncoming could provide methods that allow access to (or getting back) the TcpListener. I decided against it, but they could be added if there is a use case
  • IMO the into_incoming method should return an opaque impl IntoIterator so that IntoIncoming is not public API, but that would be inconsistent with the rest of std.
@piegamesde piegamesde added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Aug 26, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 23, 2024
…coming_issue_number, r=workingjubilee

Fix issue number for the `tcplistener_into_incoming` feature

As per [this comment](rust-lang#88339 (comment)), the issue number for the `tcplistener_into_incoming` feature is the one of the PR that implements it instead of the tracking issue.

- rust-lang#88339
- rust-lang#88373
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jun 23, 2024
Rollup merge of rust-lang#126783 - tguichaoua:fix_tcplistener_into_incoming_issue_number, r=workingjubilee

Fix issue number for the `tcplistener_into_incoming` feature

As per [this comment](rust-lang#88339 (comment)), the issue number for the `tcplistener_into_incoming` feature is the one of the PR that implements it instead of the tracking issue.

- rust-lang#88339
- rust-lang#88373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

1 participant