-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
io: Add the Peek trait #87620
io: Add the Peek trait #87620
Conversation
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
☔ The latest upstream changes (presumably #87329) made this pull request unmergeable. Please resolve the merge conflicts. |
Ping from triage: |
Okay, I will that. |
I rebased it, but it seems that I cannot change the label to |
@rustbot label: -S-waiting-on-author +S-waiting-on-review |
|
I will add implement for
Should I create a new tracking issue? |
This comment has been minimized.
This comment has been minimized.
Add the trait for each struct which has a peek function.
What I mean is, currently stable code can't use If So the actual question of this is, whether the |
I understand that, so this PR has to be merged after the stabilization.
The reason, why it does not rely on anywhere, is that it was not there yet.
With this argument, then many things should not be in |
We discussed this in today's @rust-lang/libs-api meeting. We came to consensus on two points:
|
☔ The latest upstream changes (presumably #81156) made this pull request unmergeable. Please resolve the merge conflicts. |
My use case is: |
This seems to be |
No, really. It is like |
Triage: |
Based on #87620 (comment), it sounds like this will need an evaluation of the use case presented in #87620 (comment) to determine if there's a desire to add the API. Marking as waiting-on-team for that. These days, it's probably the case that the discussion should be had on an ACP, but I'm not sure what our policy on pre-existing PRs is there. |
I think we've been tending to ask existing PRs to go through the ACP process. |
Closing this as it is inactive and would need an ACP |
Add the trait for each struct which has a peek function.
Motivation
This new Trait make it possible to write a generic, where a stream is required, in which the data is not removed from the queue. Unfortunately, there are already peek method for some struct for example
TcpStream
, which make it not consistent (dirty).