aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-03-12 11:26:45 -0500
committerJesse Luehrs <doy@tozt.net>2021-03-12 11:26:45 -0500
commit4ead14a3153b34941570e87d67064e4aa93fa01a (patch)
tree8735f60ef0983878c5aba92b6874274a7754110a
parent9885f5ca8db5060f95066b16f68f69c1a858cf0f (diff)
downloadtextmode-4ead14a3153b34941570e87d67064e4aa93fa01a.tar.gz
textmode-4ead14a3153b34941570e87d67064e4aa93fa01a.zip
naming
-rw-r--r--src/blocking/input.rs4
-rw-r--r--src/blocking/output.rs4
-rw-r--r--src/input.rs4
-rw-r--r--src/lib.rs2
-rw-r--r--src/output.rs6
-rw-r--r--src/private.rs4
6 files changed, 12 insertions, 12 deletions
diff --git a/src/blocking/input.rs b/src/blocking/input.rs
index fc173f0..ea34536 100644
--- a/src/blocking/input.rs
+++ b/src/blocking/input.rs
@@ -3,7 +3,7 @@ use crate::error::*;
use std::io::Read as _;
use std::os::unix::io::AsRawFd as _;
-use crate::private::InputImpl as _;
+use crate::private::Input as _;
pub struct RawGuard {
termios: nix::sys::termios::Termios,
@@ -62,7 +62,7 @@ pub struct Input {
parse_single: bool,
}
-impl crate::private::InputImpl for Input {
+impl crate::private::Input for Input {
fn buf(&self) -> &[u8] {
&self.buf[self.pos..]
}
diff --git a/src/blocking/output.rs b/src/blocking/output.rs
index d966550..85faac1 100644
--- a/src/blocking/output.rs
+++ b/src/blocking/output.rs
@@ -2,7 +2,7 @@ use crate::error::*;
use std::io::Write as _;
-use crate::private::TextmodeImpl as _;
+use crate::private::Output as _;
pub struct ScreenGuard {
cleaned_up: bool,
@@ -34,7 +34,7 @@ pub struct Output {
next: vt100::Parser,
}
-impl crate::private::TextmodeImpl for Output {
+impl crate::private::Output for Output {
fn cur(&self) -> &vt100::Parser {
&self.cur
}
diff --git a/src/input.rs b/src/input.rs
index 7a87c8c..7568de2 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -3,7 +3,7 @@ use crate::error::*;
use futures_lite::io::AsyncReadExt as _;
use std::os::unix::io::AsRawFd as _;
-use crate::private::InputImpl as _;
+use crate::private::Input as _;
pub struct RawGuard {
termios: nix::sys::termios::Termios,
@@ -75,7 +75,7 @@ pub struct Input {
parse_single: bool,
}
-impl super::private::InputImpl for Input {
+impl crate::private::Input for Input {
fn buf(&self) -> &[u8] {
&self.buf[self.pos..]
}
diff --git a/src/lib.rs b/src/lib.rs
index 79caedc..ca58146 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -21,7 +21,7 @@ pub use input::{Input, RawGuard};
const INIT: &[u8] = b"\x1b7\x1b[?47h\x1b[2J\x1b[H\x1b[?25h";
const DEINIT: &[u8] = b"\x1b[?47l\x1b8\x1b[?25h";
-pub trait Textmode: private::TextmodeImpl {
+pub trait Textmode: private::Output {
fn screen(&self) -> &vt100::Screen {
self.next().screen()
}
diff --git a/src/output.rs b/src/output.rs
index 63c0b08..28411e1 100644
--- a/src/output.rs
+++ b/src/output.rs
@@ -2,7 +2,7 @@ use crate::error::*;
use futures_lite::io::AsyncWriteExt as _;
-use super::private::TextmodeImpl as _;
+use crate::private::Output as _;
pub struct ScreenGuard {
cleaned_up: bool,
@@ -45,7 +45,7 @@ pub struct Output {
next: vt100::Parser,
}
-impl super::private::TextmodeImpl for Output {
+impl crate::private::Output for Output {
fn cur(&self) -> &vt100::Parser {
&self.cur
}
@@ -63,7 +63,7 @@ impl super::private::TextmodeImpl for Output {
}
}
-impl super::Textmode for Output {}
+impl crate::Textmode for Output {}
impl Output {
pub async fn new() -> Result<(Self, ScreenGuard)> {
diff --git a/src/private.rs b/src/private.rs
index a925a27..6bb37a9 100644
--- a/src/private.rs
+++ b/src/private.rs
@@ -1,4 +1,4 @@
-pub trait TextmodeImpl {
+pub trait Output {
fn cur(&self) -> &vt100::Parser;
fn cur_mut(&mut self) -> &mut vt100::Parser;
fn next(&self) -> &vt100::Parser;
@@ -15,7 +15,7 @@ pub trait TextmodeImpl {
}
}
-pub trait InputImpl {
+pub trait Input {
fn buf(&self) -> &[u8];
fn buf_mut(&mut self) -> &mut [u8];
fn buf_mut_vec(&mut self) -> &mut Vec<u8>;