知识卡片
兼容承诺包括行为与构建边界
接口兼容不只看函数签名,还包括调用者依赖的行为、默认feature、许可策略和最低支持Rust版本。它们变化可能使原有用户无法使用,即使代码仍编译。应明确项目承诺并持续检查;MSRV升级是否算破坏变更需说明政策,不能假定生态有统一答案。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 4. Dependencies Semver for Crate Authors · 查看原书依据
MSRV) increase as a non-breaking change, so consider whether the MSRV forms part of your API. An obvious corollary of the rules is this: the fewer public items a crate has, the fewer things there are that can induce an incompatible change (Item 22). However, there’s no escaping the fact that comparing all public API items for compatibility from one release t
参考来源
- 位置:《Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)》第4章《Semver for Crate Authors》(spine8;extracted/Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)/_epub-src/OEBPS/ch04.html;u116-ch04-004)。
- 结论依据:原文在“MSRV”附近的定义、例子或代码支撑本卡核心说明:接口兼容不只看函数签名,还包括调用者依赖的行为、默认feature、许可策略和最低支持Rust版本。边界按已读前提解释;示例未执行。
- 原始内容:MSRV) increase as a non-breaking change, so consider whether the MSRV forms part of your API. An obvious corollary of the rules is this: the fewer public items a crate has, the fewer things there are that can induce an incompatible change (Item 22). However, there’s no escaping the fact that comparing all public API items for compatibility from one release t