Struct std::io::LineWriterUnstable [-] [+] [src]

pub struct LineWriter<W> {
    // some fields omitted
}

Wraps a Writer and buffers output to it, flushing whenever a newline (0x0a, '\n') is detected.

This writer will be flushed when it is dropped.

Methods

impl<W: Write> LineWriter<W>

fn new(inner: W) -> LineWriter<W>

Creates a new LineWriter

fn get_ref<'a>(&'a self) -> &'a W

Gets a reference to the underlying writer.

This type does not expose the ability to get a mutable reference to the underlying reader because that could possibly corrupt the buffer.

fn into_inner(self) -> Result<W, IntoInnerError<LineWriter<W>>>

Unwraps this LineWriter, returning the underlying writer.

The internal buffer is flushed before returning the writer.

Trait Implementations

impl<W: Write> Write for LineWriter<W>

fn write(&mut self, buf: &[u8]) -> Result<usize>

fn flush(&mut self) -> Result<()>

fn write_all(&mut self, buf: &[u8]) -> Result<()>

fn write_fmt(&mut self, fmt: Arguments) -> Result<()>

impl<W> Debug for LineWriter<W> where W: Debug

fn fmt(&self, fmt: &mut Formatter) -> Result