My Rust Utilities
运行测试
cargo test生成并查看文档
cargo doc --workspace --opencargo xtask ci依次执行:
- 格式化检查 (
cargo fmt --all --check) - Clippy lint (
cargo clippy --workspace --all-targets --all-features -D warnings) - 单元测试 (
cargo test --workspace --all-targets) - 文档生成 (
cargo doc --workspace --all-features --no-deps) - Miri 检查 (
cargo +nightly miri test ...)
cargo xtask run fmt
cargo xtask run test -- --nocapture
cargo xtask run clippy -- -D clippy::pedantic将执行单个任务
- math
- num 数值库:包含常用数值 trait、分数 Frac、复数 Complex、向量 Vector2/Vector3、矩阵 Matrix
- bignum 高精度数值库:包含高精度整数 BigInteger、高精度浮点数 BigDecimal
- expr 表达式库:包含表达式求值 Expr
- graph 图算法库
- net
- http 服务器
- data structure
- 红黑树:RBTreeMap
- 斐波那契堆:FibonacciHeap,给 graph 用
- 并查集:UnionFind,给 graph 用
- 线段树:SegmentTree,数组实现,支持区间求和/最大/最小查询和更新
- 树状数组:FenwickTree,数组实现,支持区间前缀和/更新,O(log n)
- trie 树:Trie
- hierarchy 层次结构库:包含 LCRS 封装层次结构 LCRSTree、Vec 存储层次结构 Tree,提供统一接口
- 运算底层编写独立函数,上层封装多种引用模式,并与多种标量互运算,使用宏简化
- unchecked 函数推荐加#[inline(always)],将所有 unsafe 函数放在一个独立的 impl 块中