pub struct LineWriter<W: AsyncWrite> { /* private fields */ }
This is supported on crate feature io only.
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

This is supported on crate feature io only.

Creates a future which will entirely flush this AsyncWrite. Read more

This is supported on crate feature io only.

Creates a future which will entirely close this AsyncWrite.

This is supported on crate feature io only.

Creates a future which will write bytes from buf into the object. Read more

This is supported on crate feature io only.

Creates a future which will write bytes from bufs into the object using vectored IO operations. Read more

This is supported on crate feature io only.

Write data into this object. Read more

This is supported on crate feature io only.

Attempts to write multiple buffers into this writer. Read more

This is supported on crate features io and io-compat only.

Wraps an AsyncWrite in a compatibility wrapper that allows it to be used as a futures 0.1 / tokio-io 0.1 AsyncWrite. Requires the io-compat feature to enable. Read more

This is supported on crate features io and sink only.

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

Performs the conversion.

Performs the conversion.

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.