Struct stijl::TermStream
[−]
[src]
pub struct TermStream<T> { /* fields omitted */ }
A styled stream using terminfo escape sequences.
Instances are lightweight, using only four escape sequences (instead of copying entire terminfo descriptions).
Methods
impl TermStream<Stdout>
[src]
fn stdout(do_style: DoStyle) -> TermStream<Stdout>
[src]
A TermStream
that wraps std::io::stdout()
, using the
current terminal description.
impl TermStream<Stderr>
[src]
fn stderr(do_style: DoStyle) -> TermStream<Stderr>
[src]
A TermStream
that wraps std::io::stderr()
, using the
current terminal description.
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>
[src]
Write a buffer into this object, returning how many bytes were written. Read more
fn flush(&mut self) -> Result<()>
[src]
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[src]
Attempts to write an entire buffer into this write. Read more
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
Writes a formatted string into this writer, returning any error encountered. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
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.
fn reset(&mut self) -> Result<()>
[src]
Sends the sgr0
escape sequence.
fn fg(&mut self, fg: Color) -> Result<()>
[src]
Sends the setaf
escape sequence.
fn em(&mut self) -> Result<()>
[src]
Sends the bold
, smul
, or smso
escape sequence (depending
on which is supported by the terminfo description).
fn is_cli(&self) -> bool
[src]
True if the stream is connected to a command-line interface.
impl CLIStream for TermStream<Stdout>
[src]
fn rewind_lines(&mut self, count: u16) -> Result<()>
[src]
"Rewind" the stream so that the last count
lines can be overwritten. Read more
fn get_size(&self) -> WinSize
[src]
The size of the command-line window. Read more
impl CLIStream for TermStream<Stderr>
[src]
fn rewind_lines(&mut self, count: u16) -> Result<()>
[src]
"Rewind" the stream so that the last count
lines can be overwritten. Read more
fn get_size(&self) -> WinSize
[src]
The size of the command-line window. Read more
impl<'a> CLIStream for TermStream<StdoutLock<'a>>
[src]
fn rewind_lines(&mut self, count: u16) -> Result<()>
[src]
"Rewind" the stream so that the last count
lines can be overwritten. Read more
fn get_size(&self) -> WinSize
[src]
The size of the command-line window. Read more