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

Add AsyncBufRead trait #1552

Merged
merged 1 commit into from
Apr 25, 2019
Merged

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Apr 25, 2019

This adds AsyncBufRead trait and AsyncBufRead::read_until method.

(I'm writing async BufWriter now, but I want to add some methods and trait implementations that require AsyncSeek, so I would like to add traits ahead.)

cc #1519

futures-io/src/lib.rs Outdated Show resolved Hide resolved
@taiki-e taiki-e force-pushed the io-async-buf-read branch from 52fd329 to 1fb2e15 Compare April 25, 2019 09:47
@@ -324,3 +322,61 @@ pub trait AsyncWriteExt: AsyncWrite {
}

impl<W: AsyncWrite + ?Sized> AsyncWriteExt for W {}

/// An extension trait which adds utility methods to `AsyncBufRead` types.
pub trait AsyncBufReadExt: AsyncBufRead {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine we'll also want read_line, lines etc. but those can wait for a followup

@taiki-e taiki-e force-pushed the io-async-buf-read branch from 1fb2e15 to 0058ab4 Compare April 25, 2019 17:12
@taiki-e taiki-e force-pushed the io-async-buf-read branch from 0058ab4 to bca5017 Compare April 25, 2019 17:59
@cramertj cramertj merged commit 0a2d040 into rust-lang:master Apr 25, 2019
@taiki-e taiki-e deleted the io-async-buf-read branch April 25, 2019 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants