版权说明

这是一本 Rust 编程语言指南, 由 Ian Jackson 撰写并对内容和观点负责.

本指南中文版由 Hantong Chen 翻译, 遵照原作者的版权声明.

最后修订和审核时间为 2022 年 12 月(第一版发布于 2021 年 9 月), 翻译于 2025 年 4 月.

规范位置

渲染后的文档可以在这里找到: https://rust-polyglot.han.rs

贡献

囿于译者自身水平, 译文虽已力求准确, 但仍可能词不达意, 欢迎提 Issue 或 PR 批评指正.

原文贡献说明参见英文原文.

Contributions are very welcome, ideally via Issue or Merge Request:

https://salsa.debian.org/iwj/rust-polyglot/

I am happy to hear contrary views, especially about the recommendations about particular crates. However, I will make the final decision about the content of this guide.

格式, 构建:

文档采用 mdbookpandoc Markdown 的交集格式, 内容位于 src/ 目录中.

要格式化为 HTML, 你需要 cargo install mdbook 并运行 make, 但我们也欢迎未经测试的贡献.

法律信息:

请确保表明你同意 开发者原创声明 中的声明, 例如在你的提交中添加 Signed-off-by 行.

致谢你的贡献:

如果你希望在下面的列表中得到致谢, 请在那里添加你的名字 (作为你的合并请求的一部分).

隐私:

请注意, 由于本指南在 git 中维护, 你的贡献和任何致谢 将永久记录在 git 历史中, 以便追溯、审计、透明度和致谢.

致谢

感谢以下人员提供有益的审阅、评论和建议: Simon Tatham, Mark Wooding, Daniel Silverstone, 以及其他人.

感谢 Mark Wooding 提供 LaTeX/PDF 支持.

法律声明

面向多语言程序员的 Rust 指南

版权所有 2021-2022 Ian Jackson 及贡献者.

SPDX-License-Identifier: MIT.

不提供任何保证

This is "Rust for the Polyglot Programmer",
a guide to the Rust programming language.

  Copyright (c) 2021-2022 Ian Jackson and contributors

  Permission is hereby granted, free of charge, to any person
  obtaining a copy of this software and associated documentation files
  (the "Software"), to deal in the Software without restriction,
  including without limitation the rights to use, copy, modify, merge,
  publish, distribute, sublicense, and/or sell copies of the Software,
  and to permit persons to whom the Software is furnished to do so,
  subject to the following conditions:

  The above copyright notice and this permission notice shall be
  included in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  SOFTWARE.

For a list of the contributors to this guide, see the git history.


Formalities
-----------

Individual files generally contain the following tag (or similar)
in the copyright notice, instead of the full licence grant text:
  SPDX-License-Identifier: MIT
As is conventional, this should be read as a licence grant.

Contributions to Rust for the Polyglot Programmer are accepted based
on the git commit Signed-off-by convention, by which the contributors'
certify their contributions according to the Developer Certificate of
Origin version 1.1 - see the file DEVELOPER-CERTIFICATE.

If you create a new file please be sure to add an appropriate licence
header, probably something like this:
// Copyright by contributors to Rust for the Polyglot Programmer
// SPDX-License-Identifier: MIT
// There is NO WARRANTY.

Developer Certificate of Origin (DEVELOPER-CERTIFICATE)

Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.


formatted 2025-04-19 21:34:28 UTC

git commit 06fc8b3faa38546db97383ff8c9c20cac3be1565; tree dirty