Open
Description
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
- Implementation: Add TcpListener::into_incoming and IntoIncoming #88339
- Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- The
IntoIncoming
could provide methods that allow access to (or getting back) theTcpListener
. I decided against it, but they could be added if there is a use case - IMO the
into_incoming
method should return an opaqueimpl IntoIterator
so thatIntoIncoming
is not public API, but that would be inconsistent with the rest ofstd
.