tuxtui_core/
lib.rs

1//! # tuxtui-core
2//!
3//! Core types and traits for the tuxtui Terminal UI library.
4//!
5//! This crate provides the foundational building blocks for terminal user interfaces:
6//! - **Style**: Colors, modifiers, and styling primitives
7//! - **Text**: Rich text with spans, lines, and paragraphs
8//! - **Buffer**: Double-buffered terminal cell storage with efficient diffing
9//! - **Layout**: Flexible constraint-based layout engine with caching
10//! - **Backend**: Platform-agnostic terminal abstraction trait
11//! - **Theme**: Themable UI components with serialization support
12//!
13//! ## Features
14//!
15//! - `std` (default): Enable standard library support
16//! - `layout-cache`: Enable LRU caching for layout calculations
17//! - `serde`: Enable serialization/deserialization
18//! - `palette`: Enable advanced color manipulation with HSL/HSLuv
19//! - `portable-atomic`: Use portable atomics for no-std compatibility
20//! - `anstyle`: Enable anstyle conversions
21//! - `underline-color`: Enable colored underlines
22//! - `scrolling-regions`: Enable terminal scrolling region support
23//!
24//! ## Example
25//!
26//! ```rust
27//! use tuxtui_core::{buffer::Buffer, geometry::Rect, style::{Color, Style}};
28//!
29//! let mut buffer = Buffer::empty(Rect::new(0, 0, 10, 5));
30//! let style = Style::default().fg(Color::Blue);
31//! buffer.set_string(0, 0, "Hello", style);
32//! ```
33
34#![cfg_attr(not(feature = "std"), no_std)]
35#![cfg_attr(docsrs, feature(doc_cfg))]
36#![forbid(unsafe_code)]
37#![warn(missing_docs)]
38
39extern crate alloc;
40
41pub mod backend;
42pub mod buffer;
43pub mod event;
44pub mod geometry;
45pub mod layout;
46pub mod prelude;
47pub mod style;
48pub mod symbols;
49pub mod terminal;
50pub mod text;
51pub mod theme;
52pub mod util;
53pub mod viewport;
54
55#[cfg(test)]
56mod tests;