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

When does LineWriter flush? #42468

Closed
8573 opened this issue Jun 6, 2017 · 1 comment
Closed

When does LineWriter flush? #42468

8573 opened this issue Jun 6, 2017 · 1 comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. P-medium Medium priority

Comments

@8573
Copy link

8573 commented Jun 6, 2017

It seems unclear to me from its documentation when exactly
std::io::LineWriter will flush.

The documentation of the struct says that it flushes "whenever a
newline […] is detected", but the existence and documentation of the
constructor with_capacity suggests that LineWriter has an internal
buffer of some set capacity.

What happens if a line written to the LineWriter exceeds the
capacity of the internal buffer? Can LineWriter also flush before
a newline is detected?

@retep998
Copy link
Member

retep998 commented Jun 6, 2017

Yes, LineWriter will also flush whenever the internal buffer is full (1024 bytes last I checked).

@Mark-Simulacrum Mark-Simulacrum added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Jun 23, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 27, 2017
@steveklabnik steveklabnik added the P-medium Medium priority label Aug 30, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this issue Jan 2, 2018
kennytm added a commit to kennytm/rust that referenced this issue Jan 3, 2018
… r=QuietMisdreavus

Document when LineWriter flushes; document errors for into_inner.

Fixes rust-lang#42468.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-enhancement Category: An issue proposing an enhancement or a PR with one. P-medium Medium priority
Projects
None yet
Development

No branches or pull requests

4 participants