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;
9
10#[cfg(unix)]
11pub mod app;
12#[cfg(unix)]
13pub mod events;
14#[cfg(unix)]
15pub mod headless;
16#[cfg(unix)]
17pub mod pacing;
18#[cfg(unix)]
19pub mod pane;
20#[cfg(unix)]
21mod stop;
22#[cfg(unix)]
23pub mod tty;
24
25/// Failures of the terminal lifecycle: the crate's one error enum.
26#[derive(Debug, thiserror::Error)]
27pub enum RtError {
28    /// An open, read or write on the terminal failed: no controlling
29    /// terminal exists, or the stream broke mid-exchange.
30    #[error("terminal io failed: {0}")]
31    Io(#[from] std::io::Error),
32    /// A termios or poll operation failed mid-exchange.
33    #[cfg(unix)]
34    #[error("terminal control failed: {0}")]
35    Control(#[from] rustix::io::Errno),
36}