Rust 程序设计语言 简体中文版 1.85.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 8.1. 使用 Vector 储存列表 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 中,创建自定义类型需要用到结构体和枚举。 第七章介绍 Rust 的模块(module)系统,其中的私有性规则用来组织代码和公开的 API(应 用程序接口)。第八章讨论标准库提供的常见集合数据结构,例如 Vector(向量)、字符串和 Hash Map(散列表)。第九章探索 Rust 的错误处理的理念与技术。 第十章深入介绍泛型(generic)、Trait 和生命周期(lifetime),这些功能让你能够定义适用 有用。但是数组并不如 vector 类 型灵活。vector 类型是标准库提供的一个 允许 增长和缩小长度的类似数组的集合类型。当不 确定是应该使用数组还是 vector 的时候,那么很可能应该使用 vector。第八章会详细讨论 vector。 然而,当你确定元素个数不会改变时,数组会更有用。例如,当你在一个程序中使用月份名字 时,你更应趋向于使用数组而不是 vector,因为你确定只会有 120 码力 | 562 页 | 3.23 MB | 1 月前3
The Servo Book - 0.0.1example, to run our Conway’s Game of Life demo with WebGPU enabled: Use --devtools=6080 to enable support for debugging pages with Firefox DevTools: Built servoshell yourself? When you build it yourself to set up your environment before continuing with the steps below. To build servoshell for your machine: There are multiple profiles available for build. debug is default profile if no profile is passed the shell.nix , change the line if ! [ -e /etc/NIXOS ]; then to if false; then to disable the support in shell.nix for producing binary artifacts that don't depend on the nix store. If you get this0 码力 | 107 页 | 2.48 MB | 3 天前3
共 2 条
- 1













