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

draft Add BufWriter #90

Closed
wants to merge 5 commits into from
Closed

draft Add BufWriter #90

wants to merge 5 commits into from

Conversation

Drevoed
Copy link
Contributor

@Drevoed Drevoed commented Aug 20, 2019

This pull request will resolve #83 when merged.

It includes asynchronous BufWriter and LineWriter with tests.
Currently I'm having problems with implementing poll_write for BufWriter, because trying to call
self.buf().write(buf).poll(cx) results in

error[E0599]: no method named `poll` found for type `io::write::WriteFuture<'_, std::vec::Vec<u8>>` in the current scope
   --> src/io/buf_writer.rs:239:33
    |
239 |             self.buf().write(buf).poll(cx)
    |                                 ^^^^
    |
   ::: src/io/write.rs:149:1
    |
149 | pub struct WriteFuture<'a, T: Unpin + ?Sized> {
    | --------------------------------------------- method `poll` not found for this
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following traits define an item `poll`, perhaps you need to implement one of them:
            candidate #1: `core::future::future::Future`
            candidate #2: `futures::future::Future`
            candidate #3: `futures::stream::Stream`

. I assume that's because WriteFuture has trait bounds on ?Sized but I'm not sure how to get around that.

@Drevoed
Copy link
Contributor Author

Drevoed commented Aug 20, 2019

r? @skade

@Drevoed Drevoed closed this Aug 20, 2019
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.

Add BufWriter
1 participant