rust基础入门[23] - More About Lifetimes
本章覆盖有:
- 简单、自由(free)函数和方法需要避免写入生命周期指示器(lifetime specifiers),因为它们是被推断的
- 为什么包含引用的结构体(structs)、元组-结构体(tuple-structs)、枚举(enums)需要生命周期指示器(lifetime specifiers)
- 如何为结构体(structs)、元组-结构体(tuple-structs)、枚举(enums)编写生命周期指示器(lifetime specifiers)
- 为什么包含指向泛型参数的结构体需要生命周期边界(协变、逆协变)
rust基础入门[22] - Borrowing and Lifetimes
本章覆盖有:
- “租借,borrowing”和“生命周期,lifetime”的概念
- 困扰系统软件的租借典型错误是哪些
- 如何通过租借checker,Rust的严格语法来避免这种典型错误
- 如何通过插入语句块来约束租借的作用域(scope)
- 为什么函数返回的引用需要生命周期指示符(specifiers)
- 如何给函数使用生命周期指示符(lifetime specifiers),它们表示什么
- 租借checker的任务是什么
rust基础入门[21] - Drops, Moves, and Copies
本章覆盖有:
- 为什么决定性的(deterministic)、隐式(implicit)的对象销毁是Rust的一大亮点
- 对象所有者(ownership)的概念
- 为什么自定义销毁可能有用,怎么创建
- 三种赋值语义:共享(share)、拷贝(copy)、移动(move)
- 为什么隐式共享对软件正确性是糟糕的
- 为什么对象的移动(move semantics)比起拷贝(copy semantics)可能有更好的性能
- 为什么某些类型需要拷贝(copy semantics),某些不需要,怎么区分
- 为什么某些类型需要是不可复制的(non-cloneable),怎么区分
rust基础入门[20] - Standard Library Collections
本章覆盖有:
- 如何度量运行部分代码所花费的时间
- 基于性能因素,如何使用哪种类型的集合
- 集合中的各种操作中哪个更好:顺序扫描(sequential scan)、两端插入和删除(insertion and removal of items at both ends)、删除最大项(removal of the largest item)、搜索(search)、键搜索(search by key)、保持顺序(keeping items sorted)