aboutsummaryrefslogtreecommitdiffstats
path: root/src/ratatui/backend/mod.rs
diff options
context:
space:
mode:
authorVladislav Stepanov <8uk.8ak@gmail.com>2023-04-14 23:18:58 +0400
committerGitHub <noreply@github.com>2023-04-14 20:18:58 +0100
commitc05d2850420a2c163b8f62c33a6cef7c0ae1ad8d (patch)
tree2c44a44eda7e76fa74e78ac1fd02f55c1ed4d804 /src/ratatui/backend/mod.rs
parentSwitch to uuidv7 (#864) (diff)
downloadatuin-c05d2850420a2c163b8f62c33a6cef7c0ae1ad8d.zip
Workspace reorder (#868)
* Try different workspace structure Move main crate (atuin) to be on the same level with other crates in this workspace * extract common dependencies to the workspace definition * fix base64 v0.21 deprecation warning * questionable: update deps & fix chrono deprecations possible panic sites are unchanged, they're just more visible now * Revert "questionable: update deps & fix chrono deprecations" This reverts commit 993e60f8dea81a1625a04285a617959ad09a0866.
Diffstat (limited to 'src/ratatui/backend/mod.rs')
-rw-r--r--src/ratatui/backend/mod.rs58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/ratatui/backend/mod.rs b/src/ratatui/backend/mod.rs
deleted file mode 100644
index a360db18..00000000
--- a/src/ratatui/backend/mod.rs
+++ /dev/null
@@ -1,58 +0,0 @@
-use std::io;
-
-use crate::ratatui::buffer::Cell;
-use crate::ratatui::layout::Rect;
-
-#[cfg(feature = "termion")]
-mod termion;
-#[cfg(feature = "termion")]
-pub use self::termion::TermionBackend;
-
-mod crossterm;
-pub use self::crossterm::CrosstermBackend;
-
-#[derive(Debug, Clone, Copy, PartialEq)]
-pub enum ClearType {
- All,
- AfterCursor,
- BeforeCursor,
- CurrentLine,
- UntilNewLine,
-}
-
-pub trait Backend {
- fn draw<'a, I>(&mut self, content: I) -> Result<(), io::Error>
- where
- I: Iterator<Item = (u16, u16, &'a Cell)>;
-
- /// Insert `n` line breaks to the terminal screen
- fn append_lines(&mut self, n: u16) -> io::Result<()> {
- // to get around the unused warning
- let _n = n;
- Ok(())
- }
-
- fn hide_cursor(&mut self) -> Result<(), io::Error>;
- fn show_cursor(&mut self) -> Result<(), io::Error>;
- fn get_cursor(&mut self) -> Result<(u16, u16), io::Error>;
- fn set_cursor(&mut self, x: u16, y: u16) -> Result<(), io::Error>;
-
- /// Clears the whole terminal screen
- fn clear(&mut self) -> Result<(), io::Error>;
-
- /// Clears a specific region of the terminal specified by the [`ClearType`] parameter
- fn clear_region(&mut self, clear_type: ClearType) -> Result<(), io::Error> {
- match clear_type {
- ClearType::All => self.clear(),
- ClearType::AfterCursor
- | ClearType::BeforeCursor
- | ClearType::CurrentLine
- | ClearType::UntilNewLine => Err(io::Error::new(
- io::ErrorKind::Other,
- format!("clear_type [{clear_type:?}] not supported with this backend"),
- )),
- }
- }
- fn size(&self) -> Result<Rect, io::Error>;
- fn flush(&mut self) -> Result<(), io::Error>;
-}