Struct tui::terminal::Terminal
[−]
[src]
pub struct Terminal<B> where
B: Backend, { /* fields omitted */ }
Interface to the terminal backed by Termion
Methods
impl<B> Terminal<B> where
B: Backend,
[src]
B: Backend,
fn new(backend: B) -> Result<Terminal<B>, Error>
Wrapper around Termion initialization. Each buffer is initialized with a blank string and default colors for the foreground and the background
fn backend(&self) -> &B
fn backend_mut(&mut self) -> &mut B
fn compute_layout(&mut self, group: &Group, area: &Rect) -> Vec<Rect>
Check if we have already computed a layout for a given group, otherwise it creates one and add it to the layout cache. Moreover the function marks the queried entries so that we can clean outdated ones at the end of the draw call.
fn flush(&mut self) -> Result<(), Error>
Builds a string representing the minimal escape sequences and characters set necessary to update the UI and writes it to stdout.
fn render<W>(&mut self, widget: &W, area: &Rect) where
W: Widget,
W: Widget,
Calls the draw method of a given widget on the current buffer
fn resize(&mut self, area: Rect) -> Result<(), Error>
Updates the interface so that internal buffers matches the current size of the terminal. This leads to a full redraw of the screen.
fn draw(&mut self) -> Result<(), Error>
Flushes the current internal state and prepares the interface for the next draw call