Skip to main content

katui_rt/
lib.rs

1//! The katui runtime: the one impure layer. It owns the controlling
2//! terminal, the raw-mode lifecycle, the frame clock, the event pump and
3//! the interactive loop. Everything pure lives in the crates below.
4
5pub mod clock;
6pub mod info;
7pub mod media;
8pub mod session;
9pub mod stash;
10
11#[cfg(unix)]
12pub mod app;
13#[cfg(unix)]
14pub mod events;
15#[cfg(unix)]
16pub mod headless;
17#[cfg(unix)]
18pub mod pacing;
19#[cfg(unix)]
20pub mod pane;
21#[cfg(unix)]
22mod stop;
23#[cfg(unix)]
24pub mod tty;
25
26/// Failures of the terminal lifecycle: the crate's one error enum.
27#[derive(Debug, thiserror::Error)]
28pub enum RtError {
29    /// An open, read or write on the terminal failed: no controlling
30    /// terminal exists, or the stream broke mid-exchange.
31    #[error("terminal io failed: {0}")]
32    Io(#[from] std::io::Error),
33    /// A termios or poll operation failed mid-exchange.
34    #[cfg(unix)]
35    #[error("terminal control failed: {0}")]
36    Control(#[from] rustix::io::Errno),
37}