diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-03-07 18:07:13 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-03-07 18:07:13 -0500 |
commit | 50b48b744fbe51accf19526a23b071ff43c9a24b (patch) | |
tree | 2187e9c4552f438ee032cb74ccced1f9b0736e3e /src | |
parent | 169af47fef8eb2a7d599ba21c1bd33eb4030267f (diff) | |
download | textmode-50b48b744fbe51accf19526a23b071ff43c9a24b.tar.gz textmode-50b48b744fbe51accf19526a23b071ff43c9a24b.zip |
a few renames
Diffstat (limited to 'src')
-rw-r--r-- | src/async.rs | 8 | ||||
-rw-r--r-- | src/blocking.rs | 10 | ||||
-rw-r--r-- | src/lib.rs | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/async.rs b/src/async.rs index 92a4f30..0a858c8 100644 --- a/src/async.rs +++ b/src/async.rs @@ -2,12 +2,12 @@ use futures_lite::io::AsyncWriteExt as _; use super::private::TextmodeImpl as _; -pub struct Textmode { +pub struct Output { cur: vt100::Parser, next: vt100::Parser, } -impl super::private::TextmodeImpl for Textmode { +impl super::private::TextmodeImpl for Output { fn cur(&self) -> &vt100::Parser { &self.cur } @@ -25,9 +25,9 @@ impl super::private::TextmodeImpl for Textmode { } } -impl super::TextmodeExt for Textmode {} +impl super::Textmode for Output {} -impl Textmode { +impl Output { pub async fn new() -> std::io::Result<Self> { let (rows, cols) = match terminal_size::terminal_size() { Some((terminal_size::Width(w), terminal_size::Height(h))) => { diff --git a/src/blocking.rs b/src/blocking.rs index 538f051..53cc54c 100644 --- a/src/blocking.rs +++ b/src/blocking.rs @@ -2,12 +2,12 @@ use std::io::Write as _; use super::private::TextmodeImpl as _; -pub struct Textmode { +pub struct Output { cur: vt100::Parser, next: vt100::Parser, } -impl super::private::TextmodeImpl for Textmode { +impl super::private::TextmodeImpl for Output { fn cur(&self) -> &vt100::Parser { &self.cur } @@ -25,9 +25,9 @@ impl super::private::TextmodeImpl for Textmode { } } -impl super::TextmodeExt for Textmode {} +impl super::Textmode for Output {} -impl Textmode { +impl Output { pub fn new() -> std::io::Result<Self> { let (rows, cols) = match terminal_size::terminal_size() { Some((terminal_size::Width(w), terminal_size::Height(h))) => { @@ -65,7 +65,7 @@ impl Textmode { } } -impl Drop for Textmode { +impl Drop for Output { fn drop(&mut self) { let _ = self.write_stdout(super::DEINIT); } @@ -9,7 +9,7 @@ pub use input::{Input, Key}; #[cfg(feature = "async")] pub mod r#async; #[cfg(feature = "async")] -pub use r#async::Textmode; +pub use r#async::Output; const INIT: &[u8] = b"\x1b7\x1b[?47h\x1b[2J\x1b[H\x1b[?25h"; const DEINIT: &[u8] = b"\x1b[?47l\x1b8\x1b[?25h"; @@ -33,7 +33,7 @@ mod private { } } -pub trait TextmodeExt: private::TextmodeImpl { +pub trait Textmode: private::TextmodeImpl { fn screen(&self) -> &vt100::Screen { self.next().screen() } |