crates/tui-core/src/lib.rs 2.4 KiB raw
1
//! Core primitives for the `rustik_tui` facade crate.
2
//!
3
//! The core keeps terminal I/O at the edge: applications own their state,
4
//! render into a reusable [`Buffer`], and flush through a narrow backend.
5
//! Widgets are plain values that measure themselves with [`Constraint`] and
6
//! write styled [`Cell`] values into the frame buffer.
7
//!
8
//! Styled text moves through three layers:
9
//!
10
//! - [`Paint<T>`](Paint) attaches a [`Style`] to any display value.
11
//! - [`Label`] is one cleaned, single-line styled text run used by [`Line`].
12
//! - [`Cell`] is the final buffer unit: one terminal glyph plus its style.
13
//!
14
#![deny(unsafe_code)]
15
#![warn(missing_docs)]
16
#![warn(clippy::unwrap_used)]
17
18
/// Widget alignment wrappers.
19
pub mod aligned;
20
/// ANSI color and style primitives.
21
pub mod ansi;
22
/// Application update and render traits.
23
pub mod app;
24
/// Terminal backends.
25
pub mod backend;
26
/// Shared border drawing primitives.
27
pub mod border;
28
/// Cell buffer and dirty-run diffing.
29
pub mod buffer;
30
/// Table cell sizing and padding support.
31
pub mod cell;
32
/// Shared terminal color palette.
33
pub mod colors;
34
/// Typed terminal events.
35
pub mod event;
36
/// Frame passed into application render calls.
37
pub mod frame;
38
/// Horizontal layout container.
39
pub mod hstack;
40
/// Text label widget.
41
pub mod label;
42
/// Strongly typed terminal layout primitives.
43
pub mod layout;
44
/// Core line and sizing primitives.
45
pub mod primitive;
46
/// Column-aligned table widget.
47
pub mod table;
48
/// Double-buffered terminal renderer.
49
pub mod terminal;
50
/// Styled text constructors.
51
pub mod text;
52
/// Wrapped text area widget.
53
pub mod textarea;
54
/// Vertical layout container.
55
pub mod vstack;
56
/// Immediate-mode widgets.
57
pub mod widget;
58
59
pub use aligned::{Align, Aligned};
60
pub use ansi::Color;
61
pub use ansi::{Filled, Paint, PaintMode, Painted, Style, paint};
62
pub use app::{App, Control, drive};
63
pub use backend::{Backend, TestBackend};
64
pub use border::{Border, BorderChars};
65
pub use buffer::{Buffer, Cell};
66
pub use cell::Text;
67
pub use event::{Event, Key, Modifiers, Mouse, MouseButton};
68
pub use frame::Frame;
69
pub use hstack::HStack;
70
pub use label::{Label, label};
71
pub use layout::{Direction, Length, Point, Rect};
72
pub use primitive::{Constraint, Line, Size, StyledLine};
73
pub use table::{Column, Table, TableOptions};
74
pub use terminal::Terminal;
75
pub use textarea::{TextArea, textarea};
76
pub use vstack::{VStack, VStackOptions};
77
pub use widget::{Block, Clear, Fill, RenderResult, StatefulWidget, Widget};