-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.In the final comment period and will be merged soon unless new substantive objections are raised.
Description
It seems like a reasonably obvious thing to do and would be trivial to implement. The only alternative right now is to always use .by_ref()
before calling .take()
, and that's not always viable (e.g. because the io::Take
needs to be kept around without borrowing the owner of the underlying reader).
An example usage would be implementing a message-based protocol on top of a stream protocol, where the messages either have fixed-length frames or have length indicators, I might want to call .take()
to be able to work with a single message and then .into_inner()
when I'm done to recover the underlying reader.
Metadata
Metadata
Assignees
Labels
B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.In the final comment period and will be merged soon unless new substantive objections are raised.