Struct stijl::TermStream [] [src]

pub struct TermStream<T> { /* fields omitted */ }

A styled stream using terminfo escape sequences.

Instances are lightweight, using only three escape sequences (instead of copying entire terminfo descriptions).

Methods

impl TermStream<Stdout>
[src]

A TermStream that wraps std::io::stdout(), using the current terminal description.

impl TermStream<Stderr>
[src]

A TermStream that wraps std::io::stderr(), using the current terminal description.

impl<T: Write> TermStream<T>
[src]

Create a TermStream that wraps a std::io::Write, using the terminfo description given by desc.

If do_style is false, or desc[sgr0] is empty, the Stream methods (reset, fg, and em) will have no effect.

Trait Implementations

impl LockableStream for TermStream<Stdout>
[src]

Lock the stream, returning a writable guard.

impl LockableStream for TermStream<Stderr>
[src]

Lock the stream, returning a writable guard.

impl<T: Write> Write for TermStream<T>
[src]

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

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

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

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

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

impl<T: Write> Stream for TermStream<T>
[src]

The Stream methods of this implementation may return anErr(Error) if there is an I/O error writing to the wrapped stream, or if the TermStream object was created from a broken terminfo description with invalid escape sequences.

Sends the sgr0 escape sequence.

Sends the setaf escape sequence.

Sends the bold, smul, or smso escape sequence (depending on which is supported by the terminfo description).