Struct tui::terminal::Terminal [−][src]
pub struct Terminal<B> where
B: Backend, { /* fields omitted */ }
Interface to the terminal backed by Termion
Implementations
impl<B> Terminal<B> where
B: Backend,
[src]
impl<B> Terminal<B> where
B: Backend,
[src]pub fn new(backend: B) -> Result<Terminal<B>>
[src]
Wrapper around Terminal initialization. Each buffer is initialized with a blank string and default colors for the foreground and the background
pub fn with_options(backend: B, options: TerminalOptions) -> Result<Terminal<B>>
[src]
UNSTABLE
pub fn get_frame(&mut self) -> Frame<'_, B>
[src]
Get a Frame object which provides a consistent view into the terminal state for rendering.
pub fn current_buffer_mut(&mut self) -> &mut Buffer
[src]
pub fn backend(&self) -> &B
[src]
pub fn backend_mut(&mut self) -> &mut B
[src]
pub fn flush(&mut self) -> Result<()>
[src]
Obtains a difference between the previous and the current buffer and passes it to the current backend for drawing.
pub fn resize(&mut self, area: Rect) -> Result<()>
[src]
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.
pub fn autoresize(&mut self) -> Result<()>
[src]
Queries the backend for size and resizes if it doesn’t match the previous size.
pub fn draw<F>(&mut self, f: F) -> Result<CompletedFrame<'_>> where
F: FnOnce(&mut Frame<'_, B>),
[src]
F: FnOnce(&mut Frame<'_, B>),
Synchronizes terminal size, calls the rendering closure, flushes the current internal state and prepares for the next draw call.
pub fn hide_cursor(&mut self) -> Result<()>
[src]
pub fn show_cursor(&mut self) -> Result<()>
[src]
pub fn get_cursor(&mut self) -> Result<(u16, u16)>
[src]
pub fn set_cursor(&mut self, x: u16, y: u16) -> Result<()>
[src]
pub fn clear(&mut self) -> Result<()>
[src]
Clear the terminal and force a full redraw on the next draw call.
pub fn size(&self) -> Result<Rect>
[src]
Queries the real size of the backend.
Trait Implementations
Auto Trait Implementations
impl<B> RefUnwindSafe for Terminal<B> where
B: RefUnwindSafe,
impl<B> RefUnwindSafe for Terminal<B> where
B: RefUnwindSafe,
impl<B> UnwindSafe for Terminal<B> where
B: UnwindSafe,
impl<B> UnwindSafe for Terminal<B> where
B: UnwindSafe,