The Servo Book - 0.0.1location. 4. Switch into the SDK folder with cd/ . 5. Create a sub-folder with the same name as the API version (e.g 14 for SDK v5.0.2) and switch into it. 6. Unzip reports parallelism benefits. High-Performance and Energy-Efficient Mobile Web Browsing on Big/Little Systems Save power by dynamically switching which core to use based on automatic workload heuristic C3: An methods calls into. If you later realize this private method can be used from other structs, make it pub(crate) . For each algorithm step in the spec: Copy the line from the spec. Implement the spec in code(which 0 码力 | 107 页 | 2.48 MB | 3 天前3
Rust 程序设计语言 简体中文版 1.85.0简体中文版 定义模块来控制作用域与私有性 在本节,我们将讨论模块和其它一些关于模块系统的部分,如允许你命名项的 路径(paths); 用来将路径引入作用域的 use 关键字;以及使项变为公有的 pub 关键字。我们还将讨论 as 关 键字、外部包(external packages)和 glob 运算符(glob operator)。 首先,我们将从一系列的规则开始,在你未来组织代码的时候,这些规则可被用作简单的参 些规则可被用作简单的参 考。接下来我们将会详细的解释每条规则。 模块小抄(Cheat Sheet) 在深入了解模块和路径的细节之前,这里提供一个简单的参考,用来解释模块、路径、use关 键词和pub关键词如何在编译器中工作,以及大部分开发者如何组织他们的代码。我们将在本 章中举例说明每条规则,但这是回顾模块工作原理的绝佳参考。 • 从 crate 根节点开始: 当编译一个 crate, 编译器首先在 crate::garden::vegetables::Asparagus 访 问。 • 私有 vs 公用: 一个模块里的代码默认对其父模块私有。为了使一个模块公用,应当在声明时 使用 pub mod 替代 mod。为了使一个公用模块内部的成员公用,应当在声明前使用pub。 • use 关键字: 在一个作用域内,use关键字创建了一个项的快捷方式,用来减少长路径的重 复。在任何可以引用 crate::garden::vegetables::Asparagus0 码力 | 562 页 | 3.23 MB | 1 月前3
共 2 条
- 1













