mirror of https://github.com/fdehau/tui-rs
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
854 B
Rust
34 lines
854 B
Rust
use std::io;
|
|
|
|
use crate::buffer::Cell;
|
|
use crate::layout::Rect;
|
|
|
|
#[cfg(feature = "rustbox")]
|
|
mod rustbox;
|
|
#[cfg(feature = "rustbox")]
|
|
pub use self::rustbox::RustboxBackend;
|
|
|
|
#[cfg(feature = "termion")]
|
|
mod termion;
|
|
#[cfg(feature = "termion")]
|
|
pub use self::termion::TermionBackend;
|
|
|
|
#[cfg(feature = "crossterm")]
|
|
mod crossterm;
|
|
#[cfg(feature = "crossterm")]
|
|
pub use self::crossterm::CrosstermBackend;
|
|
|
|
mod test;
|
|
pub use self::test::TestBackend;
|
|
|
|
pub trait Backend {
|
|
fn draw<'a, I>(&mut self, content: I) -> Result<(), io::Error>
|
|
where
|
|
I: Iterator<Item = (u16, u16, &'a Cell)>;
|
|
fn hide_cursor(&mut self) -> Result<(), io::Error>;
|
|
fn show_cursor(&mut self) -> Result<(), io::Error>;
|
|
fn clear(&mut self) -> Result<(), io::Error>;
|
|
fn size(&self) -> Result<Rect, io::Error>;
|
|
fn flush(&mut self) -> Result<(), io::Error>;
|
|
}
|