pub struct Terminal { /* private fields */ }Expand description
Terminal handle for I/O operations.
Implementations§
Source§impl Terminal
impl Terminal
Sourcepub fn refresh_size(&mut self) -> Result<()>
pub fn refresh_size(&mut self) -> Result<()>
Refresh terminal size.
Sourcepub fn clear_from_cursor(&mut self) -> Result<()>
pub fn clear_from_cursor(&mut self) -> Result<()>
Clear from cursor to end of screen.
Sourcepub fn clear_line(&mut self) -> Result<()>
pub fn clear_line(&mut self) -> Result<()>
Clear the current line.
Sourcepub fn move_cursor(&mut self, x: u16, y: u16) -> Result<()>
pub fn move_cursor(&mut self, x: u16, y: u16) -> Result<()>
Move cursor to position (1-indexed).
Sourcepub fn hide_cursor(&mut self) -> Result<()>
pub fn hide_cursor(&mut self) -> Result<()>
Hide the cursor.
Sourcepub fn show_cursor(&mut self) -> Result<()>
pub fn show_cursor(&mut self) -> Result<()>
Show the cursor.
Sourcepub fn save_cursor(&mut self) -> Result<()>
pub fn save_cursor(&mut self) -> Result<()>
Save cursor position.
Sourcepub fn restore_cursor(&mut self) -> Result<()>
pub fn restore_cursor(&mut self) -> Result<()>
Restore cursor position.
Sourcepub fn enter_alternate_screen(&mut self) -> Result<()>
pub fn enter_alternate_screen(&mut self) -> Result<()>
Enable alternate screen buffer.
Sourcepub fn leave_alternate_screen(&mut self) -> Result<()>
pub fn leave_alternate_screen(&mut self) -> Result<()>
Disable alternate screen buffer.
Sourcepub fn enable_mouse(&mut self) -> Result<()>
pub fn enable_mouse(&mut self) -> Result<()>
Enable mouse capture.
Sourcepub fn disable_mouse(&mut self) -> Result<()>
pub fn disable_mouse(&mut self) -> Result<()>
Disable mouse capture.
Sourcepub fn enable_raw_mode(&self) -> Result<()>
pub fn enable_raw_mode(&self) -> Result<()>
Enable raw mode.
Sourcepub fn disable_raw_mode(&self) -> Result<()>
pub fn disable_raw_mode(&self) -> Result<()>
Disable raw mode.
Sourcepub fn is_raw_mode(&self) -> bool
pub fn is_raw_mode(&self) -> bool
Check if raw mode is enabled.
Sourcepub fn read_event(
&self,
timeout: Option<Duration>,
) -> Result<Option<TerminalEvent>>
pub fn read_event( &self, timeout: Option<Duration>, ) -> Result<Option<TerminalEvent>>
Read a single event with optional timeout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Terminal
impl RefUnwindSafe for Terminal
impl Send for Terminal
impl Sync for Terminal
impl Unpin for Terminal
impl UnwindSafe for Terminal
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