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
Unresolved Questions
Feature gate:
#![feature(bufwriter_into_parts)]This is a tracking issue for
BufWriter::into_partsand its associated error type etc.This allows a
BufWriterto 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 (unlikeinto_inner) succeeding even if the underlying writer is returning errors.Public API
Steps / History
Unresolved Questions
into_raw_partsbe calledinto_parts? Tracking Issue for BufWriter::into_parts #80690 (comment)