[][src]Struct tui::terminal::Terminal

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]

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<()> where
    F: FnOnce(&mut Frame<'_, B>), 
[src]

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

impl<B: Debug> Debug for Terminal<B> where
    B: Backend
[src]

impl<B> Drop for Terminal<B> where
    B: Backend
[src]

Auto Trait Implementations

impl<B> RefUnwindSafe for Terminal<B> where
    B: RefUnwindSafe
[src]

impl<B> Send for Terminal<B> where
    B: Send
[src]

impl<B> Sync for Terminal<B> where
    B: Sync
[src]

impl<B> Unpin for Terminal<B> where
    B: Unpin
[src]

impl<B> UnwindSafe for Terminal<B> where
    B: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.