Trait ratatui::backend::Backend

source ·
pub trait Backend {
    // Required methods
    fn draw<'a, I>(&mut self, content: I) -> Result<(), Error>
       where I: Iterator<Item = (u16, u16, &'a Cell)>;
    fn hide_cursor(&mut self) -> Result<(), Error>;
    fn show_cursor(&mut self) -> Result<(), Error>;
    fn get_cursor(&mut self) -> Result<(u16, u16), Error>;
    fn set_cursor(&mut self, x: u16, y: u16) -> Result<(), Error>;
    fn clear(&mut self) -> Result<(), Error>;
    fn size(&self) -> Result<Rect, Error>;
    fn flush(&mut self) -> Result<(), Error>;

    // Provided methods
    fn append_lines(&mut self, n: u16) -> Result<()> { ... }
    fn clear_region(&mut self, clear_type: ClearType) -> Result<(), Error> { ... }
}

Required Methods§

source

fn draw<'a, I>(&mut self, content: I) -> Result<(), Error>where I: Iterator<Item = (u16, u16, &'a Cell)>,

source

fn hide_cursor(&mut self) -> Result<(), Error>

source

fn show_cursor(&mut self) -> Result<(), Error>

source

fn get_cursor(&mut self) -> Result<(u16, u16), Error>

source

fn set_cursor(&mut self, x: u16, y: u16) -> Result<(), Error>

source

fn clear(&mut self) -> Result<(), Error>

Clears the whole terminal screen

source

fn size(&self) -> Result<Rect, Error>

source

fn flush(&mut self) -> Result<(), Error>

Provided Methods§

source

fn append_lines(&mut self, n: u16) -> Result<()>

Insert n line breaks to the terminal screen

source

fn clear_region(&mut self, clear_type: ClearType) -> Result<(), Error>

Clears a specific region of the terminal specified by the ClearType parameter

Implementors§