Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cavvy 6.1.0 破坏性变更

Result API

错误处理 API 以 Result<T, E> 为规范形式。旧版专用结果容器应逐步迁移到泛型 Result,并显式声明错误类型。

? 运算符返回类型

使用 ? 的函数必须返回能够承载被传播错误的 Result 类型;不能在普通值返回函数中直接使用。

终止函数

unwrapexpectpanic 在错误分支会终止当前执行路径。需要可恢复流程时应使用 mapandThen 或显式分支。