Skip to content

When does LineWriter flush? #42468

Closed
Closed
@8573

Description

@8573

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.P-mediumMedium priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions