summary refs log tree commit diff
path: root/src/types.rs
diff options
context:
space:
mode:
authorIrene Knapp <ireneista@irenes.space>2026-03-27 03:04:59 -0700
committerIrene Knapp <ireneista@irenes.space>2026-03-27 03:04:59 -0700
commit4997c2a4e4856b49668a3d1257e967597c7dfb92 (patch)
treeca3e489cac81a176eed5cf3e9ceaa9949f4a9d88 /src/types.rs
parent2dc0e6470d65762df6c57e28cc32ee8b69844867 (diff)
implement abstractions Terminal and Buffer
Terminal encapsulates most of the already-existing logic for drawing things

Buffer corresponds directly to the user-facing concept of a buffer. it has facilities for creating a new empty one; for loading itself from a file; and for scanning its contents to compute the offsets to the start of each line.

at the moment, the assumption is that buffers are always entirely in-memory, but this will not always be true, so significant attention has been paid to aysnc behavior. there's locks in a few places which may or may not turn out to be how it ultimately works, but they seem like a credible first attempt.

the draw() routine is the heart of what exists so-far, doing all the really interesting stuff.

Force-Push: yes
Change-Id: Ifddc5debb12628233113c0bd6db3ea8cf10e6a5a
Diffstat (limited to 'src/types.rs')
-rw-r--r--src/types.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/types.rs b/src/types.rs
new file mode 100644
index 0000000..ef45492
--- /dev/null
+++ b/src/types.rs
@@ -0,0 +1,6 @@
+#![forbid(unsafe_code)]
+pub use crate::terminal::Terminal;
+
+pub type Error = std::io::Error;
+pub type Result<T> = std::result::Result<T, Error>;
+