all_term 0.1.0

Cross-platform terminal abstraction library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{
    style::Style,
    key::Key,
};

pub trait TerminalBackend: Send {
    fn enable_raw_mode(&mut self) -> Result<(), String>;
    fn disable_raw_mode(&mut self) -> Result<(), String>;
    fn enable_alternate_screen(&mut self);
    fn disable_alternate_screen(&mut self);
    fn clear_screen(&mut self);
    fn hide_cursor(&mut self);
    fn show_cursor(&mut self);
    fn move_cursor(&mut self, x: usize, y: usize);
    fn print(&mut self, text: &str, style: Style);
    fn get_size(&self) -> Result<(usize, usize), String>;
    fn read_key(&mut self) -> Key;
}