01-箱子、栈和堆
箱子、栈和堆 — Rust By Example
1分钟内可阅读完
译文 · 基于 Rust By Example
原文链接: https://doc.rust-lang.org/stable/rust-by-example/std.html
标准库提供了很多自定义类型,在原生类型基础上进行了大量扩充。这是部分自定义类型:
String(字符串),如: "hello world"[1, 2, 3]Option<i32>Result<i32, i32>Box<i32>箱子、栈和堆 — Rust By Example
动态数组 vector — Rust By Example
字符串 String — Rust By Example
选项 Option — Rust By Example
结果 Result — Rust By Example
panic! — Rust By Example
散列表 HashMap — Rust By Example
引用计数 Rc — Rust By Example
共享引用计数 Arc — Rust By Example