Struct std::io::LineWriter
[−]
[src]
pub struct LineWriter<W: Write> { // some fields omitted }
Wraps a Writer and buffers output to it, flushing whenever a newline
(0x0a
, '\n'
) is detected.
The buffer will be written out when the writer is dropped.
Methods
impl<W: Write> LineWriter<W>
fn new(inner: W) -> LineWriter<W>
Creates a new LineWriter
fn with_capacity(cap: usize, inner: W) -> LineWriter<W>
Creates a new LineWriter
with a specified capacity for the internal
buffer.
fn get_ref(&self) -> &W
Gets a reference to the underlying writer.
fn get_mut(&mut self) -> &mut W
Gets a mutable reference to the underlying writer.
Caution must be taken when calling methods on the mutable reference returned as extra writes could corrupt the output stream.
fn into_inner(self) -> Result<W, IntoInnerError<LineWriter<W>>>
Unwraps this LineWriter
, returning the underlying writer.
The internal buffer is written out before returning the writer.