Rust 核心库和标准库的源码级中文翻译,可作为 IDE 工具的智能提示 (Rust core library and standard library translation. can be used as IntelliSense for IDE tools)

Overview

Rust 标准库中文版

这是翻译 Rust 库 的地方, 相关源代码来自于 https://github.com/rust-lang/rust

如果您不会说英语,那么拥有使用中文的文档至关重要,即使您会说英语,使用母语也仍然能让您感到愉快。Rust 标准库是高质量的,不管是新手还是老手,都可以从中受益。

该仓库包含 rust-src 组件的所有源代码文件,并对其所有的源代码进行翻译,主要包括对 Rust 核心库的翻译,Rust 标准库的翻译,以及其他一些资源。该仓库使用 Cmtor (我写的效率工具) 程序并借助 JSON 文件来完成翻译的所有工作,当 Rust 更新时,将尽可能为其生成中文翻译。

下载翻译好的 Rust 文档

每次在构建新的中文文档时,会修复之前构建结果中存在的问题,为了尽可能的保证翻译的准确性,本仓库只提供最新版本的构建。最新的构建结果会放在 dist 目录下,您可以手动跳转到该文件夹,下载最新的构建结果。

使用 Rust 中文文档

  • 在使用中文文档时,请注意版本号,中文文档版本和 Rust 版本号必须要保持一致。
  • 必须使用 stable 版本,不要使用 betanightly 版本。
  • 在翻译后的源代码中,一些文档的底部会存在一定量的内容为空的注释行,其实这是有意为之,请不要擅自修改和删除。如果您删除了它,就会导致 source-map 失效,当 source-map 失效后,在调试源代码时就会出现执行位置和源代码位置不一致的严重问题。

如果您是刚开始使用 Rust,那么请确保 Rust 已经安装好,并且可以正常工作。在 Rust 安装成功后,您还应该通过 rustup component add rust-src 命令来安装 rust-src 组件。当安装 rust-src 组件之后,请按照以下步骤进行操作:

  1. 在终端执行: rustup default stable 来切换到 stable 版本,并确保 stable 的版本与中文版文档所对应的版本一致
  2. 在终端执行 rustup show,然后在输出中找到 rustup home 所对应的路径,然后将其在资源管理器中打开
  3. 打开 toolchains 的文件夹,在该文件夹下,找到您当前所使用的 Rust 工具链并将其打开,例如,在 Windows 平台上对应的是 stable-x86_64-pc-windows-msvc 文件夹
  4. 然后打开 lib/rustlib/src/rust 目录,这个目录下的文件夹就是 Rust 标准库源代码所在的位置
  5. lib/rustlib/src/rust/library 文件夹下的所有内容保存一份副本
  6. 下载本仓库对应的中文文档源文件,将其重命名为 library 并放置到 lib/rustlib/src/rust 文件夹下
  7. 请确保您已经在 IDE 中安装 Rust 相关插件,例如,vscode 需要安装:rust-analyzer
  8. 重新启动 IDE 工具,中文文档的智能提示开始工作
  9. 愉快的编码!

离线 HTML 文档

该中文翻译为源码级翻译,现在您可以轻松的构建离线的 HTML 文档供自己阅读。在构建离线 HTML 文档之前,您需要了解一些 Git 操作知识以及 Rust 构建流程。在这里,仅提供 HTML 离线文档的构建命令。

有关构建离线文档的更多信息,请参见:构建离线 HTML 文档

Gitee 国内镜像

为了方便国内朋友的下载和访问,Github 上的 rust-library-i18n 仓库已同步到了 Gitee,项目地址为: https://gitee.com/wtklbm/rust-library-chinese,其中 rust-library-chinese 仅为镜像仓库,如果您想找到我,请在 Github 上进行留言。

NOTE

该翻译底层基于机器翻译,但优于纯机器翻译,它只会翻译该翻译的地方,并能够保证所翻译的文档和英文文档是完全同步的,不会产生文档脱节的情况。

在翻译的过程中,因为多方面原因,难免会出现一些计算机专有名词意外被翻译,或者某些单词使用不当的情况,这个翻译我自己就在使用,翻译就是为了方便自己学习和成长,所以发现了问题就会修复,请别见怪。

该仓库以前打算是支持多种语言,实时更新的(完全绰绰有余),经过几个月下来,这些功能已经变得不那么重要,第一是因为没人愿意去校对那些语句字符串,第二就是把时间放到更能提升自己,更有意义的事情上去。所以该项目的更新策略调整为:尽量更新。除此之外,不做任何保证。

Others

crm

crm 是一个镜像源管理工具,内置了 5 种 Rust 国内镜像源,并提供了测速功能,更换镜像源特别方便。

License

MIT OR Apache-2.0

You might also like...
Purplecoin Core integration/staging tree

ℙurplecoin Official implementation of Purplecoin, the first stateless cryptocurrency. Requires Rust Nightly =v1.63.0. WARNING The source code is stil

Repo for apps for the Pocket RISC-V core for Analogue Pocket/OpenFPGA. Multiple branches.

This is a repo meant to host Rust programs for agg23's Pocket RISC-V platform. While Rust can be built out of the openfpga-litex repo directly, this r

:crab: Small exercises to get you used to reading and writing Rust code!
:crab: Small exercises to get you used to reading and writing Rust code!

rustlings 🦀 ❤️ Greetings and welcome to rustlings. This project contains small exercises to get you used to reading and writing Rust code. This inclu

This project contains small exercises to get you used to reading and writing Rust code
This project contains small exercises to get you used to reading and writing Rust code

rustlings 🦀 ❤️ Greetings and welcome to rustlings. This project contains small exercises to get you used to reading and writing Rust code. This inclu

A set of Zero Knowledge modules, written in Rust and designed to be used in other system programming environments.

Zerokit A set of Zero Knowledge modules, written in Rust and designed to be used in other system programming environments. Initial scope Focus on RLN

A relatively simple puzzle generator application written in Rust and used via Javascript
A relatively simple puzzle generator application written in Rust and used via Javascript

Puzzlip Basic Overview This is a relatively simple puzzle generator application written in Rust and used via Javascript in https://puzzlip.com. If you

Cogo is a high-performance library for programming stackful coroutines with which you can easily develop and maintain massive concurrent programs.
Cogo is a high-performance library for programming stackful coroutines with which you can easily develop and maintain massive concurrent programs.

Cogo is a high-performance library for programming stackful coroutines with which you can easily develop and maintain massive concurrent programs.

Conversion Tools API Rust client

ConversionTools Rust This Conversion Tools API Rust client allows you to use the site API and convert files faster and more conveniently. Site Convers

Tools to feature more lenient Polonius-based borrow-checker patterns in stable Rust
Tools to feature more lenient Polonius-based borrow-checker patterns in stable Rust

Though this be madness, yet there is method in 't. More context Hamlet: For yourself, sir, shall grow old as I am – if, like a crab, you could go back

Releases(v1.58.1)
Owner
wtklbm
💖 At every moment, Happy coding!
wtklbm
Core Temporal SDK that can be used as a base for language specific Temporal SDKs

Core SDK that can be used as a base for all other Temporal SDKs. Getting started See the Architecture doc for some high-level information. This repo u

temporal.io 136 Dec 21, 2022
A translation of akaritakai/AdventOfCode2021 into Rust

Advent Of Code 2021 Solutions This repo contains my Advent Of Code 2021 solutions in Rust. This repo is a learning opportunity (a "my first Rust proje

Justin Kaufman 2 Feb 7, 2022
Korean translation of Rust Language Cheat Sheet

Rust Language Cheat Sheet A single-page Rust resource for people who like high information density. Use cases, in order of priority: identification &

Chris Ohk 3 Mar 26, 2022
🦀 Rust crate that allows creating weighted prefix trees that can be used in autocomplete

weighted_trie ?? Rust crate that allows creating weighted prefix trees that can be used in autocomplete Released API Docs Quickstart To use weigthed-t

Alexander Osipenko 8 Mar 1, 2023
Rust library provides a standalone implementation of the ROS (Robot Operating System) core

ROS-core implementation in Rust This Rust library provides a standalone implementation of the ROS (Robot Operating System) core. It allows you to run

Patrick Wieschollek 3 Apr 26, 2023
Core libraries, services and CLIs for Monetæ

Core libraries, services and CLIs for Monetæ

monetæ 1 Nov 1, 2021
"Crates for Cheese" is a Rust collection library of those crates I consider a useful "extended standard".

cfc The purpose of this library is to provide a minimal list of currated crates which enhance the std library. In addition, most or all crates in this

null 0 Dec 23, 2021
June's standard rust library

Azalea June's standard libraries for rust projects. Has a lot of common code that is often important, or copied to many places in a project. Only work

Juniper Primavera 2 Aug 24, 2023
Parse and encoding of data using the SCTE-35 standard.

SCTE-35 lib and parser for Rust Work in progress! This library provide access to parse and encoding of data using the SCTE-35 standard. This standard

Rafael Carício 4 May 6, 2022
Purplecoin Core integration/staging tree

ℙurplecoin Official implementation of Purplecoin, the first stateless cryptocurrency. Requires Rust Nightly >=v1.63.0. WARNING The source code is stil

Purplecoin 5 Dec 31, 2022