-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
A-tokioArea: The main tokio crateArea: The main tokio crateA-tokio-utilArea: The tokio-util crateArea: The tokio-util crateC-feature-acceptedCategory: A feature request that has been accepted pending implementation.Category: A feature request that has been accepted pending implementation.C-feature-requestCategory: A feature request.Category: A feature request.M-codecModule: tokio-util/codecModule: tokio-util/codecM-ioModule: tokio/ioModule: tokio/io
Description
The tokio::io::stream_reader adapter allows you to convert a Stream<Item=Result<Bytes, Error>> into an AsyncRead. I would like to provide an adapter for the opposite conversion as well.
It is currently already possible to do this using
FramedRead::new(my_async_read, BytesCodec::new()).map_ok(BytesMut::freeze)from tokio-util, but this is such a common operation that I think we should provide a dedicated adapter in tokio::io as well.
Name suggestion: stream_chunker
Metadata
Metadata
Assignees
Labels
A-tokioArea: The main tokio crateArea: The main tokio crateA-tokio-utilArea: The tokio-util crateArea: The tokio-util crateC-feature-acceptedCategory: A feature request that has been accepted pending implementation.Category: A feature request that has been accepted pending implementation.C-feature-requestCategory: A feature request.Category: A feature request.M-codecModule: tokio-util/codecModule: tokio-util/codecM-ioModule: tokio/ioModule: tokio/io