Rust 2026 经验谈 - 错误处理在库与应用中的分层设计
库级 error type 设计原则(non-exhaustive 枚举、从低层错误抽象而非透传)、应用级错误聚合与展示、错误与 tracing 的协作、错误转换反模式。
Cover Image of the Post
Rust 2026 经验谈 - 可恢复 vs 不可恢复的抉择
深入 panic! vs Result 的设计哲学、panic hook 定制、catch_unwind 与 FFI 安全、abort vs unwind 策略选择,以及 panic 在测试中的独特作用。
Cover Image of the Post
Rust 2026 经验谈 - 错误处理体系 2026
深入 thiserror 2.0 + anyhow 1.0 最佳实践、Error source chain 遍历、? 操作符类型推导细节、Provider API 替代 Error::source 获取上下文,以及 eyre vs anyhow 选型。
Cover Image of the Post
Rust 2026 经验谈 - 枚举与模式匹配新范式
深入 exhaustive patterns、match ergonomics 演进、let-else 链式用法、pattern guard 限制与替代方案、irrefutable patterns 新规则,以及枚举领域建模。
Cover Image of the Post
Rust 2026 经验谈 - trait 系统进阶
深入 trait object vs impl Trait 性能抉择、trait upcasting、async fn in trait、associated type defaults、trait alias、auto trait 内部机制与 object safe 规则详解。
Cover Image of the Post
Rust 2026 经验谈 - 类型状态模式与零成本抽象
深入 PhantomData 驱动的类型状态模式、newtype 模式深挖、Deref/DerefMut 争议与正确用法、Borrow/BorrowMut trait,以及类型级编程入门。
Cover Image of the Post
Profile Image of the Author
TinyZ Zzh
专注于高并发服务器、网络游戏相关(Java、PHP、Unity3D、Unreal Engine等)技术,热爱游戏事业, 正在努力实现自我价值当中。
公告
欢迎来到我的博客!这是一则示例公告。
音乐
封面

音乐

暂未播放

0:00 0:00
暂无歌词
分类
标签
站点统计
文章
226
分类
38
标签
241
总字数
373,000
运行时长
0
最后活动
0 天前

文章目录