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.
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 theio::Takeneeds 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.