Struct tabwriter::TabWriter[][src]

pub struct TabWriter<W> { /* fields omitted */ }
Expand description

TabWriter wraps an arbitrary writer and aligns tabbed output.

Elastic tabstops work by aligning contiguous tabbed delimited fields known as column blocks. When a line appears that breaks all contiguous blocks, all buffered output will be flushed to the underlying writer. Otherwise, output will stay buffered until flush is explicitly called.

Implementations

Create a new TabWriter from an existing Writer.

All output written to Writer is passed through TabWriter. Contiguous column blocks indicated by tabs are aligned.

Note that flush must be called to guarantee that TabWriter will write to the given writer.

Set the minimum width of each column. That is, all columns will have at least the size given here. If a column is smaller than minwidth, then it is padded with spaces.

The default minimum width is 2.

Set the padding between columns. All columns will be separated by at least the number of spaces indicated by padding. If padding is zero, then columns may run up against each other without any separation.

The default padding is 2.

Set the alignment of text within cells. This will effect future flushes.

The default alignment is Alignment::Left.

Unwraps this TabWriter, returning the underlying writer.

This internal buffer is flushed before returning the writer. If the flush fails, then an error is returned.

Trait Implementations

Formats the value using the given formatter. Read more

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

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

Like write, except that it writes from a slice of buffers. Read more

🔬 This is a nightly-only experimental API. (can_vector)

Determines if this Writer has an efficient write_vectored implementation. Read more

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

🔬 This is a nightly-only experimental API. (write_all_vectored)

Attempts to write multiple buffers into this writer. Read more

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

Creates a “by reference” adapter for this instance of Write. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. 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.