Struct term::terminfo::TerminfoTerminal [] [src]

pub struct TerminfoTerminal<T> {
    // some fields omitted
}

A Terminal that knows how many colors it supports, with a reference to its parsed Terminfo database record.

Methods

impl<T: Write + Send> TerminfoTerminal<T>
[src]

fn new_with_terminfo(out: T, terminfo: TermInfo) -> TerminfoTerminal<T>

Create a new TerminfoTerminal with the given TermInfo and Write.

fn new(out: T) -> Option<TerminfoTerminal<T>>

Create a new TerminfoTerminal for the current environment with the given Write.

Returns None when the terminfo cannot be found or parsed.

Trait Implementations

impl<T: Write + Send> Terminal for TerminfoTerminal<T>
[src]

type Output = T

The terminal's output writer type.

fn fg(&mut self, color: Color) -> Result<bool>

Sets the foreground color to the given color. Read more

fn bg(&mut self, color: Color) -> Result<bool>

Sets the background color to the given color. Read more

fn attr(&mut self, attr: Attr) -> Result<bool>

Sets the given terminal attribute, if supported. Returns Ok(true) if the attribute was supported, Ok(false) otherwise, and Err(e) if there was an I/O error. Read more

fn supports_attr(&self, attr: Attr) -> bool

Returns whether the given terminal attribute is supported.

fn reset(&mut self) -> Result<bool>

Resets all terminal attributes and colors to their defaults. Read more

fn cursor_up(&mut self) -> Result<bool>

Moves the cursor up one line. Read more

fn delete_line(&mut self) -> Result<bool>

Deletes the text from the cursor location to the end of the line. Read more

fn carriage_return(&mut self) -> Result<bool>

Moves the cursor to the left edge of the current line. Read more

fn get_ref<'a>(&'a self) -> &'a T

Gets an immutable reference to the stream inside

fn get_mut<'a>(&'a mut self) -> &'a mut T

Gets a mutable reference to the stream inside

fn into_inner(self) -> T where Self: Sized

Returns the contained stream, destroying the Terminal

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

fn write(&mut self, buf: &[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