diff options
-rw-r--r-- | examples/async.rs | 2 | ||||
-rw-r--r-- | examples/basic.rs | 4 | ||||
-rw-r--r-- | src/async.rs | 2 | ||||
-rw-r--r-- | src/blocking.rs (renamed from src/sync.rs) | 2 | ||||
-rw-r--r-- | src/lib.rs | 7 |
5 files changed, 10 insertions, 7 deletions
diff --git a/examples/async.rs b/examples/async.rs index e8e4282..7c8769e 100644 --- a/examples/async.rs +++ b/examples/async.rs @@ -1,4 +1,4 @@ -use textmode::Textmode as _; +use textmode::TextmodeExt as _; async fn run(tm: &mut textmode::r#async::Textmode) -> std::io::Result<()> { tm.move_to(5, 5); diff --git a/examples/basic.rs b/examples/basic.rs index 150c9b0..a46d449 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -1,7 +1,7 @@ -use textmode::Textmode as _; +use textmode::TextmodeExt as _; fn main() { - let mut tm = textmode::sync::Textmode::new().unwrap(); + let mut tm = textmode::blocking::Textmode::new().unwrap(); tm.move_to(5, 5); tm.write_str("foo"); diff --git a/src/async.rs b/src/async.rs index a384da8..86f4bdb 100644 --- a/src/async.rs +++ b/src/async.rs @@ -25,7 +25,7 @@ impl super::private::TextmodeImpl for Textmode { } } -impl super::Textmode for Textmode {} +impl super::TextmodeExt for Textmode {} impl Textmode { pub async fn new() -> std::io::Result<Self> { diff --git a/src/sync.rs b/src/blocking.rs index 047036d..c06e0a3 100644 --- a/src/sync.rs +++ b/src/blocking.rs @@ -25,7 +25,7 @@ impl super::private::TextmodeImpl for Textmode { } } -impl super::Textmode for Textmode {} +impl super::TextmodeExt for Textmode {} impl Textmode { pub fn new() -> std::io::Result<Self> { @@ -1,8 +1,11 @@ pub mod color; +pub mod blocking; + #[cfg(feature = "async")] pub mod r#async; -pub mod sync; +#[cfg(feature = "async")] +pub use r#async::Textmode; mod private { pub trait TextmodeImpl { @@ -23,7 +26,7 @@ mod private { } } -pub trait Textmode: private::TextmodeImpl { +pub trait TextmodeExt: private::TextmodeImpl { fn cursor_position(&self) -> (u16, u16) { self.next().screen().cursor_position() } |