[−][src]Struct tui::terminal::Terminal
Interface to the terminal backed by Termion
Methods
impl<B> Terminal<B> where
B: Backend,
[src]
B: Backend,
pub fn new(backend: B) -> Result<Terminal<B>>
[src]
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>
[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(Frame<B>),
[src]
F: FnOnce(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]
pub fn size(&self) -> Result<Rect>
[src]
Queries the real size of the backend.
Trait Implementations
impl<B> Drop for Terminal<B> where
B: Backend,
[src]
B: Backend,
impl<B: Debug> Debug for Terminal<B> where
B: Backend,
[src]
B: Backend,
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,