Skip to content

Tracking Issue for BufWriter::into_parts #80690

Closed

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

Unresolved Questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: A tracking issue for an RFC or an unstable feature.Libs-TrackedLibs 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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions