pub struct LineWriter<W>where
    W: AsyncWrite,
{ /* private fields */ }
Expand description

Wrap a writer, like BufWriter does, but prioritizes buffering lines

This was written based on std::io::LineWriter which goes into further details explaining the code.

Buffering is actually done using BufWriter. This class will leverage BufWriter to write on-each-line.

Implementations

Create a new LineWriter with default buffer capacity. The default is currently 1KB which was taken from std::io::LineWriter

Creates a new LineWriter with the specified buffer capacity.

Returns a reference to buf_writer’s internally buffered data.

Acquires a reference to the underlying sink or stream that this combinator is pulling from.

Trait Implementations

Forward to buf_writer ’s BufWriter::poll_flush()

Forward to buf_writer ’s BufWriter::poll_close()

Attempt to write bytes from buf into the object. Read more
Attempt to write bytes from bufs into the object using vectored IO operations. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Creates a future which will entirely flush this AsyncWrite. Read more
Creates a future which will entirely close this AsyncWrite.
Creates a future which will write bytes from buf into the object. Read more
Creates a future which will write bytes from bufs into the object using vectored IO operations. Read more
Write data into this object. Read more
Allow using an AsyncWrite as a Sink<Item: AsRef<[u8]>>. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.