-
Notifications
You must be signed in to change notification settings - Fork 633
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
AsyncRead::poll_read() does not expose the EOF concept #1624
Comments
If you're going to go that far for type safety would The current design is consistent with |
I understand wanting to align with the |
Fixes the inconsistency between `future::empty` and `stream::empty`. I went with `pending` over `never` since there are already a future called `Never` in the library. Closes rust-lang#1624
Fixes the inconsistency between `future::empty` and `stream::empty`. I went with `pending` over `never` since there are already a future called `Never` in the library. Closes rust-lang#1624
Fixes the inconsistency between `future::empty` and `stream::empty`. I went with `pending` over `never` since there are already a future called `Never` in the library. Closes rust-lang#1624
Fixes the inconsistency between `future::empty` and `stream::empty`. I went with `pending` over `never` since there are already a future called `Never` in the library. Closes #1624
Was closing this intentional? |
Nope, that was meant to refer to #1684 instead. |
As of 85162dc,
poll_read()
is defined as:In tokio-io (which seems to be the canonical definition for futures-0.1) it is defined as:
In addition, the tokio-io documentation mentions:
I don't much like the sentinel value of
0
for EOF, and I'm confused by the notion of EOF not being reflected in the futures-0.3 version ofAsyncRead
-- is that a conscious decision?It seems to me that EOF is a real thing for many kinds of readers (both files and also network streams like TCP or QUIC streams). I was thinking that it might make sense to define the return type as
Poll<Result<Option<usize>>>
instead, so that there is the analogy with aStream
and a clearly defined marker for end of stream.The text was updated successfully, but these errors were encountered: