知识卡片
无标准库兼容不等于裸机程序完成
#![no_std]让crate使用不依赖完整std的基础环境,适合固件等目标复用库逻辑。它不会自动提供启动入口、分配器或操作系统服务,也不自动证明所有依赖不带std。应把库兼容性与完整裸机程序的运行条件分开。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 6. Beyond Standard Rust Item 33: Consider making library code no_std compatible · 查看原书依据
no_std compatible Rust comes with a standard library called std, which includes code for a wide variety of common tasks, from standard data structures to networking, from multithreading support to file I/O. For convenience, several of the items from std are automatically imported into your program, via the prelude: a set of common use statements that make co
参考来源
- 位置:《Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)》第6章《Item 33: Consider making library code no_std compatible》(spine10;extracted/Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)/_epub-src/OEBPS/ch06.html;u167-ch06-001)。
- 结论依据:原文在“no_std compatible”附近的定义、例子或代码支撑本卡核心说明:#![no_std]让crate使用不依赖完整std的基础环境,适合固件等目标复用库逻辑。边界按已读前提解释;示例未执行。
- 原始内容:no_std compatible Rust comes with a standard library called std, which includes code for a wide variety of common tasks, from standard data structures to networking, from multithreading support to file I/O. For convenience, several of the items from std are automatically imported into your program, via the prelude: a set of common use statements that make co