-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
AsyncBufRead Readline Semantics #1592
Comments
This is the same behavior as
The document says "will be appended to
|
Thanks, I did not notice the "appended to I will leave this open to allow a moderator to close it pending any further discussion on documentation or examples. I do also agree with it fitting Rust's implementation of BufRead. However as I do not use that much, I did not know this implementation detail. |
Include more details and an example. Closes #1592
Include more details and an example. Closes #1592
Version
tokio 0.2.0-alpha.4
Platform
Linux localhost.localdomain 5.2.11-200.fc30.x86_64 #1 SMP Thu Aug 29 12:43:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Description
When using the AsyncBufReadExt trait to use the readline function,
I encountered something slightly counter-intuitive. Most languages that implement
this reset the buffer on new reads, but readline did not. I confirmed this by using code
similar to the following pseudo code:
I am unsure of Rust's standard library semantics on this, yet this seems to be counter-intuitive
as their is lingering data between each call and this must be cleared explicitly.
If this is correct semantics, is it possible to update the documentation to reflect this.
It represented it self as an interesting bug for my work as it slowed everything down
and did not break my parsing logic because my parsing logic is permissive.
The text was updated successfully, but these errors were encountered: