taitank/lib.rs
1//! # Taitank Rust
2//!
3//! Taitank 是一个跨平台的轻量级 Flexbox 布局引擎的 Rust 实现。
4//!
5//! ## 特性
6//!
7//! - 完整的 Flexbox 布局支持
8//! - 高性能布局计算
9//! - 内存安全(Rust 所有权系统)
10//! - 类型安全
11//! - 与 C++ 版本 API 兼容
12//!
13//! ## 快速开始
14//!
15//! ```rust
16//! use taitank::*;
17//!
18//! // 创建根节点
19//! let root = node_create();
20//! set_width(&root, 500.0);
21//! set_height(&root, 300.0);
22//! set_flex_direction(&root, FlexDirection::Row);
23//!
24//! // 创建子节点
25//! let child = node_create();
26//! set_width(&child, 100.0);
27//! set_height(&child, 100.0);
28//! insert_child(&root, child.clone(), 0);
29//!
30//! // 执行布局计算
31//! do_layout(&root, VALUE_UNDEFINED, VALUE_UNDEFINED, TaitankDirection::Ltr, None);
32//!
33//! // 获取布局结果
34//! println!("Width: {}, Height: {}", get_width(&root), get_height(&root));
35//! ```
36//!
37//! ## 模块
38//!
39//! - [`api`] - 公共 API 接口
40//! - [`flex`] - Flexbox 相关类型和枚举
41//! - [`style`] - 样式管理
42//! - [`node`] - 节点核心实现
43//! - [`cache`] - 布局缓存
44//! - [`config`] - 配置管理
45//!
46//! ## 示例
47//!
48//! 查看 `examples/` 目录获取更多使用示例:
49//!
50//! - `basic.rs` - 基本使用示例
51//! - `complex.rs` - 复杂布局示例
52//! - `absolute_position.rs` - 绝对定位示例
53
54pub mod api;
55pub mod cache;
56pub mod config;
57pub mod error;
58pub mod flex;
59pub mod flexline;
60pub mod node;
61pub mod style;
62pub mod util;
63
64pub use api::*;
65pub use cache::*;
66pub use config::*;
67pub use flex::*;
68pub use flexline::*;
69pub use node::*;
70pub use style::*;
71pub use util::*;