Skip to content

Tracking Issue for tcplistener_into_incoming #88373

Open
@piegamesde

Description

@piegamesde

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions