diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/async.rs | 6 | ||||
-rw-r--r-- | examples/basic.rs | 4 | ||||
-rw-r--r-- | examples/tmux.rs | 14 |
3 files changed, 12 insertions, 12 deletions
diff --git a/examples/async.rs b/examples/async.rs index 7c8769e..3736cb8 100644 --- a/examples/async.rs +++ b/examples/async.rs @@ -1,6 +1,6 @@ -use textmode::TextmodeExt as _; +use textmode::Textmode as _; -async fn run(tm: &mut textmode::r#async::Textmode) -> std::io::Result<()> { +async fn run(tm: &mut textmode::r#async::Output) -> std::io::Result<()> { tm.move_to(5, 5); tm.write_str("foo"); smol::Timer::after(std::time::Duration::from_secs(2)).await; @@ -21,7 +21,7 @@ async fn run(tm: &mut textmode::r#async::Textmode) -> std::io::Result<()> { fn main() { smol::block_on(async { - let mut tm = textmode::r#async::Textmode::new().await.unwrap(); + let mut tm = textmode::r#async::Output::new().await.unwrap(); let e = run(&mut tm).await; tm.cleanup().await.unwrap(); e.unwrap(); diff --git a/examples/basic.rs b/examples/basic.rs index a46d449..fb13d89 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -1,7 +1,7 @@ -use textmode::TextmodeExt as _; +use textmode::Textmode as _; fn main() { - let mut tm = textmode::blocking::Textmode::new().unwrap(); + let mut tm = textmode::blocking::Output::new().unwrap(); tm.move_to(5, 5); tm.write_str("foo"); diff --git a/examples/tmux.rs b/examples/tmux.rs index 7f5c748..e5e4fcd 100644 --- a/examples/tmux.rs +++ b/examples/tmux.rs @@ -1,6 +1,6 @@ use pty_process::Command as _; use smol::io::{AsyncReadExt as _, AsyncWriteExt as _}; -use textmode::TextmodeExt as _; +use textmode::Textmode as _; enum Command { NewWindow, @@ -213,7 +213,7 @@ impl State { .detach(); } - async fn redraw_current_window(&mut self, tm: &mut textmode::Textmode) { + async fn redraw_current_window(&mut self, tm: &mut textmode::Output) { let window = self.current_window(); tm.clear(); let new_screen = window.vt.lock_arc().await.screen().clone(); @@ -224,7 +224,7 @@ impl State { tm.refresh().await.unwrap(); } - async fn update_current_window(&mut self, tm: &mut textmode::Textmode) { + async fn update_current_window(&mut self, tm: &mut textmode::Output) { let window = self.current_window(); let old_screen = window.screen.clone(); let new_screen = window.vt.lock_arc().await.screen().clone(); @@ -244,7 +244,7 @@ impl State { fn clear_notifications( &mut self, - tm: &mut textmode::Textmode, + tm: &mut textmode::Output, screen: &vt100::Screen, ) { if self.notifications.is_empty() { @@ -269,7 +269,7 @@ impl State { fn draw_notifications( &mut self, - tm: &mut textmode::Textmode, + tm: &mut textmode::Output, screen: &vt100::Screen, ) { if self.notifications.is_empty() { @@ -310,14 +310,14 @@ impl State { #[must_use] struct Tmux { input: textmode::Input, - tm: textmode::Textmode, + tm: textmode::Output, state: State, } impl Tmux { async fn new() -> Self { let input = textmode::Input::new(); - let tm = textmode::Textmode::new().await.unwrap(); + let tm = textmode::Output::new().await.unwrap(); let state = State::new(); Self { input, tm, state } } |