Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly refactor AsyncBufRead #2428

Closed
Darksonn opened this issue Apr 22, 2020 · 4 comments
Closed

Possibly refactor AsyncBufRead #2428

Darksonn opened this issue Apr 22, 2020 · 4 comments
Assignees
Labels
A-tokio Area: The main tokio crate C-musing Category: musings about a better world M-io Module: tokio/io
Milestone

Comments

@Darksonn
Copy link
Contributor

Darksonn commented Apr 22, 2020

In the spirit of this RFC, we should consider refactoring AsyncBufRead in a similar way to allow unlimited peeking.

It is worth noting that this removes some types' ability to implement the trait without complicating the types. This is the case for e.g. StreamReader. That said, as is, the trait is more or less only useful for read_line, and other single-byte-separated splits.

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-io Module: tokio/io C-musing Category: musings about a better world labels Apr 22, 2020
@Darksonn Darksonn added this to the v0.3 milestone Apr 22, 2020
@carllerche carllerche mentioned this issue Jul 29, 2020
10 tasks
@seanmonstar
Copy link
Member

For 0.3, I'd want to propose just removing the trait, and figuring it out when not under a time crunch.

@seanmonstar seanmonstar added P-high and removed P-high labels Sep 23, 2020
@seanmonstar
Copy link
Member

I'm still personally in favor or removing the trait and suggesting people use LinesCodec if they want that feature. However, if keeping it, here's a proposal to allow us to punt design:

Seal AsyncBufRead

We could seal the trait, similar to ToSocketAddrs. That means all the methods would be "private", and it's only usefulness is possible as bounds, and the extension methods like lines().

@carllerche
Copy link
Member

I believe that based on #2896, we will need to move AsyncBufRead -> tokio-util? It probably would be nice to include some note in the Tokio docs pointing to tokio-util.

@carllerche
Copy link
Member

We are going to punt on this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate C-musing Category: musings about a better world M-io Module: tokio/io
Projects
None yet
Development

No branches or pull requests

3 participants