知识卡片
依赖解析需要满足整张图
Cargo按整张图的版本约束选择依赖,不兼容系列可能并存,兼容系列则尽量统一并可能因精确范围冲突而失败。多版Rust类型身份不同,含原生库的依赖还需处理符号与链接约束。解析通常偏好较新版本,却还受锁文件、工具链与其他约束影响。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 4. Dependencies Item 25: Manage your dependency graph · 查看原书依据
dependency graph Like most modern programming languages, Rust makes it easy to pull in external libraries, in the form of crates. Most nontrivial Rust programs use external crates, and those crates may themselves have additional dependencies, forming a dependency graph for the program as a whole. By default, Cargo will download any crates named in the [depen
参考来源
- 位置:《Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)》第4章《Item 25: Manage your dependency graph》(spine8;extracted/Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)/_epub-src/OEBPS/ch04.html;u124-ch04-014)。
- 结论依据:原文在“dependency graph”附近的定义、例子或代码支撑本卡核心说明:Cargo按整张图的版本约束选择依赖,不兼容系列可能并存,兼容系列则尽量统一并可能因精确范围冲突而失败。边界按已读前提解释;示例未执行。
- 原始内容:dependency graph Like most modern programming languages, Rust makes it easy to pull in external libraries, in the form of crates. Most nontrivial Rust programs use external crates, and those crates may themselves have additional dependencies, forming a dependency graph for the program as a whole. By default, Cargo will download any crates named in the [depen