pub struct Terminal<B>where
B: Backend,{ /* private fields */ }
Expand description
Interface to the terminal backed by Termion
Implementations§
Source§impl Terminal<ZuiBackend<'_>>
impl Terminal<ZuiBackend<'_>>
pub fn print(&mut self, c: &str) -> Result<()>
pub fn get_size(&self) -> (u16, u16)
pub fn get_position(&self) -> (u16, u16)
pub fn size_did_change(&mut self) -> bool
pub fn enter_raw_mode(&mut self) -> Result<()>
pub fn keys(&self, stdin: Stdin) -> KeyIterator
pub fn switch_screen(&mut self) -> Result<()>
pub fn switch_main(&mut self) -> Result<()>
pub fn set_cursor_to(&mut self, x_pos: u16, y_pos: u16) -> Result<()>
pub fn blinking_block(&mut self) -> Result<()>
pub fn steady_block(&mut self) -> Result<()>
pub fn blinking_underline(&mut self) -> Result<()>
pub fn steady_underline(&mut self) -> Result<()>
pub fn blinking_bar(&mut self) -> Result<()>
pub fn steady_bar(&mut self) -> Result<()>
pub fn reset_cursor(&mut self) -> Result<()>
pub fn clear_screen(&mut self) -> Result<()>
pub fn clear_below_cursor(&mut self) -> Result<()>
pub fn clear_above_cursor(&mut self) -> Result<()>
pub fn clear_line(&mut self) -> Result<()>
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 Terminal initialization. Each buffer is initialized with a blank string and default colors for the foreground and the background
Sourcepub fn with_options(backend: B, options: TerminalOptions) -> Result<Terminal<B>>
pub fn with_options(backend: B, options: TerminalOptions) -> Result<Terminal<B>>
UNSTABLE
Sourcepub fn get_frame(&mut self) -> Frame<'_, B>
pub fn get_frame(&mut self) -> Frame<'_, B>
Get a Frame object which provides a consistent view into the terminal state for rendering.
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<()>
Obtains a difference between the previous and the current buffer and passes it to the current backend for drawing.
Sourcepub fn resize(&mut self, area: Rect) -> Result<()>
pub fn resize(&mut self, area: Rect) -> Result<()>
Updates the Terminal so that internal buffers match the requested size. Requested size will be saved so the size can remain consistent when rendering. This leads to a full clear of the screen.
Sourcepub fn autoresize(&mut self) -> Result<()>
pub fn autoresize(&mut self) -> Result<()>
Queries the backend for size and resizes if it doesn’t match the previous size.
Sourcepub fn draw<F>(&mut self, f: F) -> Result<CompletedFrame<'_>>
pub fn draw<F>(&mut self, f: F) -> Result<CompletedFrame<'_>>
Synchronizes terminal size, calls the rendering closure, flushes the current internal state and prepares for the next draw call.