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]
fn stdout(do_style: DoStyle) -> TermStream<Stdout>
A TermStream
that wraps std::io::stdout()
, using the
current terminal description.
impl TermStream<Stderr>
[src]
fn stderr(do_style: DoStyle) -> TermStream<Stderr>
A TermStream
that wraps std::io::stderr()
, using the
current terminal description.
impl<T: Write> TermStream<T>
[src]
fn new(w: T, desc: &Desc, do_style: bool) -> TermStream<T>
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]
impl LockableStream for TermStream<Stderr>
[src]
impl<T: Write> Write for TermStream<T>
[src]
fn write(&mut self, data: &[u8]) -> Result<usize>
Write a buffer into this object, returning how many bytes were written. Read more
fn flush(&mut self) -> Result<()>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0
Attempts to write an entire buffer into this write. Read more
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0
Writes a formatted string into this writer, returning any error encountered. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0
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.