[][src]Struct tabwriter::TabWriter

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

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.

Methods

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

Important traits for TabWriter<W>
pub fn new(w: W) -> TabWriter<W>[src]

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.

Important traits for TabWriter<W>
pub fn minwidth(self, minwidth: usize) -> TabWriter<W>[src]

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.

Important traits for TabWriter<W>
pub fn padding(self, padding: usize) -> TabWriter<W>[src]

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.

Important traits for TabWriter<W>
pub fn alignment(self, alignment: Alignment) -> TabWriter<W>[src]

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

The default alignment is Alignment::Left.

pub fn into_inner(self) -> Result<W, IntoInnerError<TabWriter<W>>>[src]

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

impl<W: Debug> Debug for TabWriter<W>[src]

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

Auto Trait Implementations

impl<W> RefUnwindSafe for TabWriter<W> where
    W: RefUnwindSafe

impl<W> Send for TabWriter<W> where
    W: Send

impl<W> Sync for TabWriter<W> where
    W: Sync

impl<W> Unpin for TabWriter<W> where
    W: Unpin

impl<W> UnwindSafe for TabWriter<W> where
    W: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.