pub struct Terminal<B: Backend> { /* private fields */ }Expand description
A terminal interface managing rendering and buffering.
The terminal orchestrates frame rendering, maintains double buffers, and coordinates with the backend.
§Example
ⓘ
use tuxtui_core::terminal::Terminal;
use tuxtui_core::backend::TestBackend;
let backend = TestBackend::new(80, 24);
let mut terminal = Terminal::new(backend).unwrap();
terminal.draw(|frame| {
// Render widgets
}).unwrap();Implementations§
Source§impl<B: Backend> Terminal<B>
impl<B: Backend> Terminal<B>
Sourcepub fn with_options(
backend: B,
options: TerminalOptions,
) -> Result<Self, B::Error>
pub fn with_options( backend: B, options: TerminalOptions, ) -> Result<Self, B::Error>
Create a new terminal with options.
Sourcepub fn show_cursor(&mut self) -> Result<(), B::Error>
pub fn show_cursor(&mut self) -> Result<(), B::Error>
Show the cursor.
Sourcepub fn hide_cursor(&mut self) -> Result<(), B::Error>
pub fn hide_cursor(&mut self) -> Result<(), B::Error>
Hide the cursor.
Sourcepub fn backend_mut(&mut self) -> &mut B
pub fn backend_mut(&mut self) -> &mut B
Get mutable access to the backend.
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for Terminal<B>where
B: Freeze,
impl<B> RefUnwindSafe for Terminal<B>where
B: RefUnwindSafe,
impl<B> Send for Terminal<B>where
B: Send,
impl<B> Sync for Terminal<B>where
B: Sync,
impl<B> Unpin for Terminal<B>where
B: Unpin,
impl<B> UnwindSafe for Terminal<B>where
B: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more