2 `no_std`
no_std — Comprehensive Rust
译文 · 基于 Comprehensive Rust
原文链接: https://google.github.io/comprehensive-rust/bare-metal/no_std.html
2 no_std
core
| alloc
| std
|
|---|
- 切片、
&str、CStr NonZeroU8…Option、ResultDisplay、Debug、write!…IteratorErrorpanic!、assert_eq!…NonNull 以及常见的指针相关函数Future 与 async/awaitfence、AtomicBool、AtomicPtr、AtomicU32…Duration
| Box、Cow、Arc、RcVec、BinaryHeap、BtreeMap、LinkedList、VecDequeString、CString、format!
| HashMapMutex、Condvar、Barrier、Once、RwLock、mpscFile 以及 fs 的其余部分println!、Read、Write、Stdin、Stdout 以及 io 的其余部分Path、OsStringnetCommand、Child、ExitCodespawn、sleep 以及 thread 的其余部分SystemTime、Instant
|
HashMap 依赖随机数生成器(RNG)。std 会重新导出 core 与 alloc 的内容。
01-最小示例 — Comprehensive Rust
02-alloc — Comprehensive Rust