Skip to content

Tracking Issue for feature(unix_socket_peek) #76923

@rijenkii

Description

@rijenkii
Contributor

This is a tracking issue for methods peek and peek_from on UnixStream and UnixDatagram (#73761).
The feature gate for the issue is #![feature(unix_socket_peek)].

Public API

impl UnixStream {
    pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize>
}

impl UnixDatagram {
    pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize>
    pub fn peek_from(&self, buf: &mut [u8]) -> io::Result<(usize, SocketAddr)>
}

Steps / History

  • Final Commitment Period (FCP)
    Stabilization

Unresolved Questions

  • None yet.

Activity

added
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
on Sep 19, 2020
added
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
on Sep 19, 2020
added
Libs-TrackedLibs issues that are tracked on the team's project board.
on Nov 6, 2020
added
A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`
O-unixOperating system: Unix-like
on Jan 6, 2021
daniel5151

daniel5151 commented on Apr 16, 2021

@daniel5151

Any idea when this might get stabilized?

LinkTed

LinkTed commented on Aug 3, 2021

@LinkTed
Contributor

Any news?

rijenkii

rijenkii commented on Jan 1, 2023

@rijenkii
ContributorAuthor

Sadly I have not been using Rust for the last year or so, and have not used this feature for even longer.

In more than two years that this feature has existed in unstable, no bugs have been reported.
Documentation is done, tests are done, I am not sure what else is needed for stabilization but it seems that it's all good.

@rust-lang/libs-api, asking for FCP.

jmillikin

jmillikin commented on May 10, 2023

@jmillikin
Contributor

FYI, I wrote a draft RFC for a v2 of Unix socket ancillary data support at rust-lang/rfcs#3430. One of the features it would expose from the underlying recv() / recvmsg() syscall is the MSG_PEEK flag, which has some overlap with the unix_socket_peek feature. It may be of interest to folks subscribed to this tracking issue.

philipuvarov

philipuvarov commented on Aug 13, 2023

@philipuvarov

@KodrAus hey there! It looks like you were the initial reviewer for this functionality :) (sorry for ping!) What is the process for getting this out of nightly? Seems like it's been there for 3 years

kornelski

kornelski commented on Mar 29, 2024

@kornelski
Contributor

The v2 RFC (rust-lang/rfcs#3430) proposes adding a peek option in RecvOptions for recv_message() extension trait that also requires use of IoSliceMut and AncillaryData, or wrapping in and configuring a MessageReceiver helper.

I don't think these two APIs are in conflict. The advanced API is quite complex and peeking with it is a multi-step process. Even with the advanced API available, users could prefer .peek() for its simplicity and brevity.

mmastrac

mmastrac commented on May 23, 2025

@mmastrac

There would be a lot of value in offering a basic peek method without the advanced API -- this blocks having an implementation of peek in mio, which transitively blocks tokio.

I think the peek method on UnixStream is pretty uncontroversial and could easily be stabilized to mirror TcpSocket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ioArea: `std::io`, `std::fs`, `std::net` and `std::path`C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.O-unixOperating system: Unix-likeT-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

        Participants

        @kornelski@mmastrac@jmillikin@jonas-schievink@daniel5151

        Issue actions

          Tracking Issue for feature(unix_socket_peek) · Issue #76923 · rust-lang/rust