Skip to content

Add a into_parts() method on BufWriter #7865

@aryan9600

Description

@aryan9600

Is your feature request related to a problem? Please describe.
It'd be helpful if there was a way to get the underlying buffer being used by a BufWriter instance. This could be helpful in scenarios where we want to do buffered writes while reusing the same buffer. The std library provides a way to do this using into_parts().

Describe the solution you'd like
Add a new method BufWriter:into_parts() which returns both the underlying stream and the buffer. This would return the buffer as is, i.e. any data thats sitting in the buffer is NOT flushed to the stream before the buffer is returned to the caller.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tokioArea: The main tokio crateC-feature-requestCategory: A feature request.M-ioModule: tokio/io

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions