Struct buf_redux::LineWriter [] [src]

pub struct LineWriter<W: Write>(_);

A drop-in replacement for std::io::LineWriter with more functionality.

Methods

impl<W: Write> LineWriter<W>
[src]

[src]

Wrap inner with the default buffer capacity.

[src]

Wrap inner with the given buffer capacity.

[src]

Get a reference to the inner writer.

[src]

Get a mutable reference to the inner writer.

Note

If the buffer has not been flushed, writing directly to the inner type will cause data inconsistency.

[src]

Get the capacty of the inner buffer.

[src]

Get the number of bytes currently in the buffer.

[src]

Grow the internal buffer by at least additional bytes. May not be quite exact due to implementation details of the buffer's allocator.

Note

This should not be called frequently as each call will incur a reallocation.

[src]

Flush the buffer and unwrap, returning the inner writer on success, or a type wrapping self plus the error otherwise.

[src]

Flush the buffer and unwrap, returning the inner writer and any error encountered during flushing.

[src]

Consume self and return both the underlying writer and the buffer, with the data moved to the beginning and the length truncated to contain only valid data.

Trait Implementations

impl<W: Write> Write for LineWriter<W>
[src]

[src]

Write a buffer into this object, returning how many bytes were written. Read more

[src]

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

1.0.0
[src]

Attempts to write an entire buffer into this write. Read more

1.0.0
[src]

Writes a formatted string into this writer, returning any error encountered. Read more

1.0.0
[src]

Creates a "by reference" adaptor for this instance of Write. Read more

impl<W: Debug + Write> Debug for LineWriter<W>
[src]

[src]

Formats the value using the given formatter.