Skip to content

Add normal read() / peek() async functions to AsyncBufReadExt #2144

Closed
@sdroege

Description

@sdroege

This would fill the internal buffer until the given amount is reached and then provide access to it. read() could return a value that implements Deref<Target=[u8]> and on Drop consumes the read data, peek() would only provide direct access to an &[u8].

This seems useful to have to allow copy-less operation on AsyncBufRead impls. If they implement AsyncRead in addition, a copy would always be necessary.

Inspired partially by https://boats.gitlab.io/blog/post/io-uring/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions