-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 a method to query the capacity of a BufWriter and BufReader #68558
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Seems plausible to me, thanks! This'll want to get tagged as an |
I don't see why not, it also relates to the length of the buffer returned from a call to |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
26ce48b
to
6b3df83
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
6b3df83
to
aebd0d7
Compare
That should now have a feature gate and appropriate tests. |
@bors: r+ |
📌 Commit aebd0d7 has been approved by |
Add a method to query the capacity of a BufWriter and BufReader Besides the obvious of retrieving the parameter used to construct the writer, this method allows consumers to control the number of `flush` calls during write operations. For `BufReader` it gives an upper bound on the returned buffer in `fill_buf` which might influence the allocation behaviour of a consumer.
The unstable attribute's issue number should be tracking issue's, not PR's. Opened #68833, I'll submit a follow-up PR once this is merged. |
☀️ Test successful - checks-azure |
Fix issue number of `capacity` method Follow-up of rust-lang#68558 (comment) r? @alexcrichton
Fix issue number of `capacity` method Follow-up of rust-lang#68558 (comment) r? @alexcrichton
Besides the obvious of retrieving the parameter used to construct the writer, this method allows consumers to control the number of
flush
calls during write operations. ForBufReader
it gives an upper bound on the returned buffer infill_buf
which might influence the allocation behaviour of a consumer.