-
Notifications
You must be signed in to change notification settings - Fork 19
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
merge functionality of io::Sink
into io::Empty
#49
Labels
ACP-accepted
API Change Proposal is accepted (seconded with no objections)
api-change-proposal
A proposal to add or alter unstable APIs in the standard libraries
T-libs-api
Comments
vidhanio
added
api-change-proposal
A proposal to add or alter unstable APIs in the standard libraries
T-libs-api
labels
Jun 16, 2022
I seem to have put this in the wrong place, as it is not a change to an unstable API. Apologies. |
It's a proposal for a new (initially unstable) api, which also belongs here. :) |
Oh, interesting, sorry for closing it. Thank you for the guidance! :) |
vidhanio
changed the title
merge functionality of Jul 7, 2022
io::Null
: a combination of io::Sink
and io::Empty
io::Sink
into io::Empty
This is in FCP now over at rust-lang/rust#98154 (comment) :) |
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this issue
Jul 30, 2023
merge functionality of `io::Sink` into `io::Empty` Many times, there is a need for a simple dummy `io::Read`er + `io::Write`r, but currently the only options are `io::Empty` and `io::Sink` respectively. Having both of their functionality together requires writing your own boilerplate for something that makes sense to have in the standard library. This PR adds the functionality of `io::Sink` to `io::Empty`, making `io::Empty` be able to perform the tasks of both of the previous structs. (This idea was first mentioned in rust-lang#24235) Note: I also updated some doc comments in `io::utils` in this pull request to fix inconsistencies between `io::Sink` and `io::Empty`. API Change Proposal: rust-lang/libs-team#49
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jul 30, 2023
merge functionality of `io::Sink` into `io::Empty` Many times, there is a need for a simple dummy `io::Read`er + `io::Write`r, but currently the only options are `io::Empty` and `io::Sink` respectively. Having both of their functionality together requires writing your own boilerplate for something that makes sense to have in the standard library. This PR adds the functionality of `io::Sink` to `io::Empty`, making `io::Empty` be able to perform the tasks of both of the previous structs. (This idea was first mentioned in rust-lang#24235) Note: I also updated some doc comments in `io::utils` in this pull request to fix inconsistencies between `io::Sink` and `io::Empty`. API Change Proposal: rust-lang/libs-team#49
thomcc
pushed a commit
to tcdi/postgrestd
that referenced
this issue
Oct 17, 2023
merge functionality of `io::Sink` into `io::Empty` Many times, there is a need for a simple dummy `io::Read`er + `io::Write`r, but currently the only options are `io::Empty` and `io::Sink` respectively. Having both of their functionality together requires writing your own boilerplate for something that makes sense to have in the standard library. This PR adds the functionality of `io::Sink` to `io::Empty`, making `io::Empty` be able to perform the tasks of both of the previous structs. (This idea was first mentioned in #24235) Note: I also updated some doc comments in `io::utils` in this pull request to fix inconsistencies between `io::Sink` and `io::Empty`. API Change Proposal: rust-lang/libs-team#49
dtolnay
added
the
ACP-accepted
API Change Proposal is accepted (seconded with no objections)
label
Nov 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ACP-accepted
API Change Proposal is accepted (seconded with no objections)
api-change-proposal
A proposal to add or alter unstable APIs in the standard libraries
T-libs-api
Proposal
Problem statement
Many times, there is a need for a simple dummy
io::Read
er +io::Write
r, but currently the only options areio::Empty
andio::Sink
respectively. Having both of their functionality together requires writing your own boilerplate for something that makes sense to have in the standard library. This change adds the functionality ofio::Sink
toio::Empty
, makingio::Empty
be able to perform the tasks of both of the previous structs.Motivation, use-cases
A simple idea for this is when a library requires a full stream, but as the developer, you don't really care about the output/input the library requires.
Solution sketches
I recently had a use for this, but I had to create my own entire struct for such a simple use case:
Links and related work
Pull Request: rust-lang/rust#98154
This idea was proposed in rust-lang/rust#24235 from a quick search.
This idea is also similar to the
/dev/null
on Unix.The text was updated successfully, but these errors were encountered: