Browsing Chinese (Simplified) translation

Don't show this notice anymore
Before translating, be sure to go through Launchpad Translators instructions and Chinese (Simplified) guidelines.
110 of 135 results
1.
% The Rust Crates and Modules Guide
type: Plain text
(no translation yet)
Located in src/doc/guide-crates.md:2
2.
When a project starts getting large, it's considered a good software engineering practice to split it up into a bunch of smaller pieces, and then fit them together. It's also important to have a well-defined interface, so that some of your functionality is private, and some is public. To facilitate these kinds of things, Rust has a module system.
type: Plain text
(no translation yet)
Located in src/doc/guide-crates.md:8
3.
# Basic terminology: Crates and Modules
type: Plain text
(no translation yet)
Located in src/doc/guide-crates.md:10
4.
Rust has two distinct terms that relate to the module system: "crate" and "module." A crate is synonymous with a 'library' or 'package' in other languages. Hence "Cargo" as the name of Rust's package management tool: you ship your crates to others with Cargo. Crates can produce an executable or a shared library, depending on the project.
type: Plain text
(no translation yet)
Located in src/doc/guide-crates.md:16
5.
Each crate has an implicit "root module" that contains the code for that crate. You can then define a tree of sub-modules under that root module. Modules allow you to partition your code within the crate itself.
type: Plain text
(no translation yet)
Located in src/doc/guide-crates.md:20
6.
As an example, let's make a "phrases" crate, which will give us various phrases in different languages. To keep things simple, we'll stick to "greetings" and "farewells" as two kinds of phrases, and use English and Japanese (日本語) as two languages for those phrases to be in. We'll use this module layout:
type: Plain text
(no translation yet)
Located in src/doc/guide-crates.md:25
7.
```text
+-----------+
+---| greetings |
| +-----------+
+---------+ |
| english |---+
+---------+ | +-----------+
| +---| farewells |
+---------+ | +-----------+
| phrases |---+
+---------+ | +-----------+
| +---| greetings |
+----------+ | +-----------+
| japanese |---+
+----------+ |
| +-----------+
+---| farewells |
+-----------+
```
type: Plain text
There are line breaks here. Each one represents a line break. Start a new line in the equivalent position in the translation.
There are leading/trailing spaces here. Each one represents a space character. Enter a space in the equivalent position in the translation.
(no translation yet)
Located in src/doc/guide-crates.md:45
8.
In this example, `phrases` is the name of our crate. All of the rest are modules. You can see that they form a tree, branching out from the crate "root", which is the root of the tree: `phrases` itself.
type: Plain text
(no translation yet)
Located in src/doc/guide-crates.md:49
9.
Now that we have a plan, let's define these modules in code. To start, generate a new crate with Cargo:
type: Plain text
(no translation yet)
Located in src/doc/guide-crates.md:52
10.
```bash $ cargo new phrases $ cd phrases ```
type: Plain text
(no translation yet)
Located in src/doc/guide-crates.md:57
110 of 135 results

This translation is managed by Launchpad Simplified Chinese Translators, assigned by Launchpad Translators.

You are not logged in. Please log in to work on translations.

No-one has contributed to this translation yet.