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
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
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
Attempts to write an entire buffer into this writer. Read more
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