-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.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.
Description
Feature gate: #![feature(bufwriter_into_parts)]
This is a tracking issue for BufWriter::into_parts
and its associated error type etc.
This allows a BufWriter
to be disassembled, and the inner writer to be recovered - without attempting to write out any buffered data (instead it is returnedt to the caller), and therefore (unlike into_inner
) succeeding even if the underlying writer is returning errors.
Public API
// std::io
/// Disassembles this `BufWriter<W>`, returning the underlying writer, and any buffered but
/// unwritten data.
impl<W> BufWriter<W> {
pub fn into_parts(mut self) -> (W, Result<Vec<u8>, WriterPanicked>);
}
/// Error newtype, wraps the buffered data, a `Vec<u8>`
pub struct WriterPanicked {...}
impl WriterPanicked {
pub fn into_inner(self) -> Vec<u8>;
}
impl Error for WriterPanicked {...}
impl Display for WriterPanicked {...}
impl Debug for WriterPanicked {...}
Steps / History
- Implementation: BufWriter: Provide into_raw_parts #79705
- Gain experience with this API, to see if it's good
- Stabilization PR with Final commenting period (FCP)
Unresolved Questions
- Should
into_raw_parts
be calledinto_parts
? Tracking Issue for BufWriter::into_parts #80690 (comment) - Is there a suitable simpler API for presenting this functionality? (I think not, see BufWriter: Provide into_raw_parts #79705 (comment))
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.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.