pub struct Terminal<'a, T: Write> {
pub rel_size: (u16, u16),
pub pix_size: (u16, u16),
pub stdout: &'a mut T,
pub x_pos: u16,
pub y_pos: u16,
pub cursor_mode: Cursor,
pub screen_num: u8,
pub mode: TermMode,
/* private fields */
}
Expand description
Terminal control struct
Fields§
§rel_size: (u16, u16)
§pix_size: (u16, u16)
§stdout: &'a mut T
§x_pos: u16
§y_pos: u16
§cursor_mode: Cursor
§screen_num: u8
§mode: TermMode
Implementations§
Source§impl<'a, T: Write> Terminal<'a, T>
impl<'a, T: Write> Terminal<'a, T>
pub fn new(stdout: &'a mut T) -> Result<Terminal<'_, T>, Error>
pub fn print(&mut self, x: &str) -> Result<()>
pub fn size_did_change(&mut self) -> bool
pub fn enter_raw_mode(&mut self) -> Result<()>
pub fn keys(&self, stdin: Stdin) -> KeyIterator ⓘ
pub fn switch_screen(&mut self) -> Result<()>
pub fn switch_main(&mut self) -> Result<()>
pub fn get_size(&self) -> (u16, u16)
pub fn get_position(&self) -> (u16, u16)
Source§impl<T: Write> Terminal<'_, T>
impl<T: Write> Terminal<'_, T>
pub fn set_cursor_to(&mut self, x_pos: u16, y_pos: u16) -> Result<()>
pub fn get_cursor(&self) -> Result<(u16, u16)>
pub fn show_cursor(&mut self) -> Result<()>
pub fn hide_cursor(&mut self) -> Result<()>
pub fn blinking_block(&mut self) -> Result<()>
pub fn steady_block(&mut self) -> Result<()>
pub fn blinking_underline(&mut self) -> Result<()>
pub fn steady_underline(&mut self) -> Result<()>
pub fn blinking_bar(&mut self) -> Result<()>
pub fn steady_bar(&mut self) -> Result<()>
pub fn reset_cursor(&mut self) -> Result<()>
Source§impl<T: Write> Terminal<'_, T>
impl<T: Write> Terminal<'_, T>
pub fn clear_screen(&mut self) -> Result<()>
pub fn clear_below_cursor(&mut self) -> Result<()>
pub fn clear_above_cursor(&mut self) -> Result<()>
pub fn clear_line(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for Terminal<'a, T>
impl<'a, T> RefUnwindSafe for Terminal<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Terminal<'a, T>where
T: Send,
impl<'a, T> Sync for Terminal<'a, T>where
T: Sync,
impl<'a, T> Unpin for Terminal<'a, T>
impl<'a, T> !UnwindSafe for Terminal<'a, T>
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