pub struct Terminal<B>where
B: Backend,{ /* private fields */ }Expand description
Interface to the terminal backed by Termion
Implementations§
source§impl<B> Terminal<B>where
B: Backend,
impl<B> Terminal<B>where
B: Backend,
sourcepub fn new(backend: B) -> Result<Terminal<B>>
pub fn new(backend: B) -> Result<Terminal<B>>
Wrapper around Termion initialization. Each buffer is initialized with a blank string and default colors for the foreground and the background
pub fn get_frame(&mut self) -> Frame<'_, B>
pub fn current_buffer_mut(&mut self) -> &mut Buffer
pub fn backend(&self) -> &B
pub fn backend_mut(&mut self) -> &mut B
sourcepub fn flush(&mut self) -> Result<()>
pub fn flush(&mut self) -> Result<()>
Builds a string representing the minimal escape sequences and characters set necessary to update the UI and writes it to stdout.
sourcepub fn resize(&mut self, area: Rect) -> Result<()>
pub fn resize(&mut self, area: Rect) -> Result<()>
Updates the interface so that internal buffers matches the current size of the terminal. This leads to a full redraw of the screen.
sourcepub fn draw<F>(&mut self, f: F) -> Result<()>where
F: FnOnce(Frame<'_, B>),
pub fn draw<F>(&mut self, f: F) -> Result<()>where
F: FnOnce(Frame<'_, B>),
Flushes the current internal state and prepares the interface for the next draw call