泥芹,知识开源平台,帮助你选书、读书。
本网站基于 Rust web 技术栈构建。

NiQin 分享格言: 母爱是一种巨大的火焰。 -- 罗曼·罗兰
书籍文档
开源知识和技术的书籍及文档
RustHub.org
昨日生锈创意,今天闪亮作品
兼职工作
项目私活汇聚,团队人员荟萃
博客资讯
生活和旅游、技术和管理、人工智能、大数据、Rust、Python、VR/AR/XR ……
最新推荐 更多 ……

Web Rust Web 实践零散

rust rust-web rust-web-guide rust-web-零散

##### Rust Web 实践零散 目前,仅是个人 Rust Web 开发中的一些记录。 涵盖:Rust Web 生态中的 Tide、actix-web、Yew、async-graphql、surf、handlebars-rust、rhai、jsonwebtoken,以及 mongodb 等。 完整的内容,还在进一步规划和整理之中。 学以聚之,问以辩之。终日乾乾,与时偕行。

编程语言 Rust 秘典(死灵书)

rust rust-秘典 rust-死灵书 rust-nomicon rustonomicon

《Rust 秘典》是 Unsafe Rust 的黑魔法指南。它有时被称作“死灵书”。 Rust 秘典挖掘了你在编写不安全 Rust 程序时需要了解的所有可怕的细节。 如果你希望在编写 Rust 程序的过程中获得长久而快乐的职业生涯,你应该现在回头,忘记你曾经看过这本书。 它没有必要。 然而,如果你打算编写不安全代码——或者只是想深入了解语言的内涵——这本书包含了很多有用的信息。 与 The Rust Programming Language 不同的是,我们将假设你有相当多的前期知识。 特别是,你应该对基本的系统编程和 Rust 非常熟悉。 如果你对这些主题感到困惑,你应该考虑先阅读The Book。 也就是说,我们不会假定你已经读过了,而且我们会注意偶尔在适当的时候对基础知识进行复习。 如果你想的话,你可以直接跳过The Book来看这本书:但你需要知道我们不会从头到尾地详细解释一切。 本书主要是作为The Reference的高级配套读物而存在。 《The Reference》的存在是为了详细说明语言的每一部分的语法和语义,而《Rust 秘典》的存在是为了描述如何将这些部分结合起来使用,以及你在这样做时将会遇到的问题。

编程语言 Rust 参考手册

rust rust-reference rust-参考手册

《Rust 参考手册》并非正式的语言规范,但它比“圣经”更加详尽而全面。 本书是 Rust 编程语言的主要参考手册,本书提供了3类资料: - 一些章节非正式地介绍了该语言的各种语言结构及其用法。 - 一些章节非正式地介绍了该语言的内存模型、并发模型、运行时服务、链接模型,以及调试工具。- - 附录章节提供了一些对 Rust 语言有影响的编程原理和参考资料。 ### 警告: - 此书尚未完成,记录 Rust 的所有内容需要花些时间。 - Rust 参考手册是 Rust 官方编写的 Rust 语言规范手册,由于语言还在快速迭代当中,所以本手册的内容还未固定下来。但这是一本学习和了解 Rust 全面的语言特性必不可少的书籍。

编程语言 Rust Cookbook 中文版

rust rust-cookbook rust-code-examples rust-示例

《Rust Cookbook 中文版》: - * 是 Rust 程序设计语言([Rust 官方教程简体中文版](https://rust-lang.niqin.com/zh-cn))的简要实例示例集合; * 展示了在 Rust 生态系统中,使用各类 crate 来完成常见编程任务的良好实践。 了解更多关于《Rust Cookbook 中文版》一书的信息,请阅读[关于本书](https://rust-cookbook.niqin.com/zh-cn/about.html),包括:如何阅读本书的提示、如何使用实例示例,以及关于注释的约定。

编程语言 通过例子学 Rust

rust rust-examples rust-by-example

Rust 是一门注重安全(safety)、速度(speed)和并发(concurrency)的现代系统编程语言。Rust 通过内存安全来实现以上目标,但不使用垃圾回收机制(garbage collection, GC)。 《通过例子学 Rust》(Rust By Example, RBE)内容由一系列可运行的实例组成,通过这些例子阐明了各种 Rust 的概念和基本库。想获取这些例子外的更多内容,不要忘了安装 Rust 到本地并查阅官方标准库文档。另外为了满足您的好奇心,您还可以查阅本网站的源代码。 现在让我们开始学习吧! * Hello World - 从经典的 “Hello World” 程序开始学习。 * 原生类型 - 学习有符号整型,无符号整型和其他原生类型。 * 自定义类型 - 结构体 struct 和 枚举 enum。 * 变量绑定 - 变量绑定,作用域,变量遮蔽。 * 类型系统 - 学习改变和定义类型。 * 类型转换 * 表达式 * 流程控制 - if/else,for,以及其他流程控制有关内容。 * 函数 - 学习方法、闭包和高阶函数。 * 模块 - 使用模块来组织代码。 * Crate - crate 是 Rust 中的编译单元。学习创建一个库。 * Cargo - 学习官方的 Rust 包管理工具的一些基本功能。 * 属性 - 属性是应用于某些模块、crate 或项的元数据(metadata)。 * 泛型 - 学习编写能够适用于多种类型参数的函数或数据类型。 * 作用域规则 - 作用域在所有权(ownership)、借用(borrowing)和生命周期(lifetime)中起着重要作用。 * 特性 trait - trait 是对未知类型(Self)定义的方法集。 * 宏 * 错误处理 - 学习 Rust 语言处理失败的方式。 * 标准库类型 - 学习 std 标准库提供的一些自定义类型。 * 标准库更多介绍 - 更多关于文件处理、线程的自定义类型。 * 测试 - Rust 语言的各种测试手段。 * 不安全操作 * 兼容性 * 补充 - 文档和基准测试

编程语言 Rust 程序设计语言

rust rust-book empowerment 赋能

虽然不是那么明显,但 Rust 程序设计语言的本质在于 **赋能**(*empowerment*):无论你现在编写的是何种代码,Rust 能让你在更为广泛的编程领域走得更远,写出自信。 比如,“系统层面”(“systems-level”)的工作,涉及内存管理、数据表示和并发等底层细节。从传统角度来看,这是一个神秘的编程领域,只为浸润多年的极少数人所触及,也只有他们能避开那些臭名昭著的陷阱。即使谨慎的实践者,亦唯恐代码出现漏洞、崩溃或损坏。 Rust 破除了这些障碍,其消除了旧的陷阱并提供了伴你一路同行的友好、精良的工具。想要 “深入” 底层控制的程序员可以使用 Rust,无需冒着常见的崩溃或安全漏洞的风险,也无需学习时常改变的工具链的最新知识。其语言本身更是被设计为自然而然的引导你编写出在运行速度和内存使用上都十分高效的可靠代码。 已经在从事编写底层代码的程序员可以使用 Rust 来提升抱负。例如,在 Rust 中引入并行是相对低风险的操作:编译器会为你捕获经典的错误。同时你可以自信的采取更为积极的优化,而不会意外引入崩溃或漏洞。 但 Rust 并不局限于底层系统编程。其表现力和工效足以令人愉悦的编写出 CLI 应用、web server 和很多其他类型的代码 —— 在本书中你会看到两个简单示例。使用 Rust 能将你在一个领域中学习的技能延伸到另一个领域;你可以学习 Rust 来编写 web 应用,接着将同样的技能应用到你的 Raspberry Pi(树莓派)上。 本书全面介绍了 Rust 为用户赋予的能力。其内容平易近人,致力于帮助你提升 Rust 的知识,并且提升你作为程序员整体的理解与自信。那么让我们准备深入学习 Rust 吧(打开新世界的大门 :)) —— 欢迎加入 Rust 社区! — Nicholas Matsakis 和 Aaron Turon

最新热门 更多 ……

Web Rust Web 实践零散

rust rust-web rust-web-guide rust-web-零散

##### Rust Web 实践零散 目前,仅是个人 Rust Web 开发中的一些记录。 涵盖:Rust Web 生态中的 Tide、actix-web、Yew、async-graphql、surf、handlebars-rust、rhai、jsonwebtoken,以及 mongodb 等。 完整的内容,还在进一步规划和整理之中。 学以聚之,问以辩之。终日乾乾,与时偕行。

编程语言 Cargo 手册

rust cargo cargo-book cargo-手册

Cargo 是 [Rust](https://rust-lang.niqin.com/zh-cn) 的[包管理器和构建系统](https://cargo-book.niqin.com/zh-cn/appendix/glossary.html#package-manager '"package manager" (glossary entry)')。Cargo 会下载你的 Rust [包](https://cargo-book.niqin.com/zh-cn/appendix/glossary.html#package '"package" (glossary entry)')依赖项,编译您的包,生成可分发的包,并将它们上传到 [crates.io](https://crates.io/) - Rust 社区的 *[包注册表](https://cargo-book.niqin.com/zh-cn/appendix/glossary.html#package-registry '"package registry" (glossary entry)')*。 Cargo 手册是使用 Cargo 全面指南教程,Cargo 是 Rust 的包管理器,通过本手册全面了解如何构建 Rust 程序和大型项目。

编程语言 Rust Cookbook 中文版

rust rust-cookbook rust-code-examples rust-示例

《Rust Cookbook 中文版》: - * 是 Rust 程序设计语言([Rust 官方教程简体中文版](https://rust-lang.niqin.com/zh-cn))的简要实例示例集合; * 展示了在 Rust 生态系统中,使用各类 crate 来完成常见编程任务的良好实践。 了解更多关于《Rust Cookbook 中文版》一书的信息,请阅读[关于本书](https://rust-cookbook.niqin.com/zh-cn/about.html),包括:如何阅读本书的提示、如何使用实例示例,以及关于注释的约定。

Web Tide 中文文档

rust rust-web tide web-framework

Tide 是小型而实用的 Rust web 应用程序框架,为快速开发而构建。它提供了一组健壮的特性,使得构建异步 web 应用程序和 API 更加容易、更为有趣。 Tide 指导手册正在编写中,会随着实践的推移逐步完善。 本书中所有的实例请参阅 [Tide 实例项目](https://github.com/http-rs/tide-book/tree/main/examples)。 > 💥 Tide 在\*\*生产环境的实践“脚手架”\*\*项目,请参阅 **[surfer](https://github.com/zzy/surfer)**[(github 仓库)](https://github.com/zzy/surfer)(将持续升级): > > - 纯粹 Rust 技术栈实现的博客系统,有兴趣请访问[演示站点 1](https://niqin.com),以及[演示站点 2](https://gaidun.com):。 > - 后端(backend)主要提供 graphql 服务,使用了 tide, async-graphql, jsonwebtoken, mongodb 等相关 crate。 > - 前端(frontend)提供 web 应用服务,使用了 tide, rhai, surf, graphql_client, handlebars-rust, cookie 等相关 crate。 > > 💥 关于清洁的模板项目,采用了**纯粹的 Rust 技术栈**。包括(将持续升级): > > - [Rust](https://www.rust-lang.org) - [中文文档](https://rust-lang.niqin.com) > - [Tide](https://crates.io/crates/tide) - [中文文档](https://tide-book.niqin.com) > - [async-graphql](https://crates.io/crates/async-graphql) - [中文文档](https://async-graphql.niqin.com) > - [mongodb & mongo-rust-driver](https://crates.io/crates/mongodb) > - [Surf](https://crates.io/crates/surf) > - [graphql_client](https://crates.io/crates/graphql_client) > - [handlebars-rust](https://crates.io/crates/handlebars) > - [jsonwebtoken](https://crates.io/crates/jsonwebtoken) > - [cookie-rs](https://crates.io/crates/cookie) > > 最简单但完全的示例项目,请参阅 github 仓库 **<a href="https://github.com/zzy/tide-async-graphql-mongodb">tide-async-graphql-mongodb</a>**。目前实现了如下功能(将持续升级): > > - 用户注册 > - 使用 PBKDF2 对密码进行加密(salt)和散列(hash)运算 > - 整合 JWT 鉴权的用户登录 > - 密码修改 > - 资料更新 > - 用户查询和变更 > - 项目查询和变更 > - 使用基于 Rust 实现 graphql-client 获取 GraphQL 服务端数据 > - 渲染 GraphQL 数据到 handlebars-rust 模板引擎

编程语言 通过例子学 Rust

rust rust-examples rust-by-example

Rust 是一门注重安全(safety)、速度(speed)和并发(concurrency)的现代系统编程语言。Rust 通过内存安全来实现以上目标,但不使用垃圾回收机制(garbage collection, GC)。 《通过例子学 Rust》(Rust By Example, RBE)内容由一系列可运行的实例组成,通过这些例子阐明了各种 Rust 的概念和基本库。想获取这些例子外的更多内容,不要忘了安装 Rust 到本地并查阅官方标准库文档。另外为了满足您的好奇心,您还可以查阅本网站的源代码。 现在让我们开始学习吧! * Hello World - 从经典的 “Hello World” 程序开始学习。 * 原生类型 - 学习有符号整型,无符号整型和其他原生类型。 * 自定义类型 - 结构体 struct 和 枚举 enum。 * 变量绑定 - 变量绑定,作用域,变量遮蔽。 * 类型系统 - 学习改变和定义类型。 * 类型转换 * 表达式 * 流程控制 - if/else,for,以及其他流程控制有关内容。 * 函数 - 学习方法、闭包和高阶函数。 * 模块 - 使用模块来组织代码。 * Crate - crate 是 Rust 中的编译单元。学习创建一个库。 * Cargo - 学习官方的 Rust 包管理工具的一些基本功能。 * 属性 - 属性是应用于某些模块、crate 或项的元数据(metadata)。 * 泛型 - 学习编写能够适用于多种类型参数的函数或数据类型。 * 作用域规则 - 作用域在所有权(ownership)、借用(borrowing)和生命周期(lifetime)中起着重要作用。 * 特性 trait - trait 是对未知类型(Self)定义的方法集。 * 宏 * 错误处理 - 学习 Rust 语言处理失败的方式。 * 标准库类型 - 学习 std 标准库提供的一些自定义类型。 * 标准库更多介绍 - 更多关于文件处理、线程的自定义类型。 * 测试 - Rust 语言的各种测试手段。 * 不安全操作 * 兼容性 * 补充 - 文档和基准测试

编程语言 Rhai - Rust 的嵌入式脚本语言

rust rhai embedded-scripting embedded-scripting-for-rust

Rhai is an embedded scripting language and evaluation engine for Rust that gives a safe and easy way to add scripting to any application. Targets and builds - * All CPU and O/S targets supported by Rust, including: * WebAssembly (WASM) * `no-std` * Minimum Rust version 1.57 Standard features - * Simple language similar to JavaScript+Rust with dynamic typing. * Fairly efficient evaluation (1 million iterations in 0.3 sec on a single-core, 2.3 GHz Linux VM). * Tight integration with native Rust functions and types, including getters/setters, methods and indexers. * Freely pass Rust values into a script as variables/constants via an external Scope - all clonable Rust types are supported; no need to implement any special trait. Or tap directly into the variable resolution process. * Built-in support for most common data types including booleans, integers, floating-point numbers (including Decimal), strings, Unicode characters, arrays (including packed byte arrays) and object maps. * Easily call a script-defined function from Rust. * Relatively little unsafe code (yes there are some for performance reasons). * Few dependencies - currently only smallvec, num-traits, ahash, bitflags and smartstring. * Re-entrant scripting engine can be made Send + Sync (via the sync feature). * Compile once to AST form for repeated evaluations. * Scripts are optimized (useful for template-based machine-generated scripts). * Easy custom API development via plugins system powered by procedural macros. * Function overloading and operator overloading. * Dynamic dispatch via function pointers with additional support for currying. * Closures (anonymous functions) that can capture shared values. * Some syntactic support for object-oriented programming (OOP). * Organize code base with dynamically-loadable modules, optionally overriding the resolution process. * Serialization/deserialization support via serde (requires the serde feature). * Support for minimal builds by excluding unneeded language features. * A debugging interface. Protected against attacks - * Don't Panic guarantee - Any panic is a bug. Rhai subscribes to the motto that a library should never panic the host system, and is coded with this in mind. * Sand-boxed - the scripting engine, if declared immutable, cannot mutate the containing environment unless explicitly permitted. * Rugged - protected against malicious attacks (such as stack-overflow, over-sized data, and runaway scripts etc.) that may come from untrusted third-party user-land scripts. * Track script evaluation progress and manually terminate a script run. * Passes Miri. For those who actually want their own language - * Use as a DSL. * Disable certain language features such as looping. * Further restrict the language by surgically disabling keywords and operators. * Define custom operators. * Extend the language with custom syntax.

编程语言 Rust 程序设计语言

rust rust-book empowerment 赋能

虽然不是那么明显,但 Rust 程序设计语言的本质在于 **赋能**(*empowerment*):无论你现在编写的是何种代码,Rust 能让你在更为广泛的编程领域走得更远,写出自信。 比如,“系统层面”(“systems-level”)的工作,涉及内存管理、数据表示和并发等底层细节。从传统角度来看,这是一个神秘的编程领域,只为浸润多年的极少数人所触及,也只有他们能避开那些臭名昭著的陷阱。即使谨慎的实践者,亦唯恐代码出现漏洞、崩溃或损坏。 Rust 破除了这些障碍,其消除了旧的陷阱并提供了伴你一路同行的友好、精良的工具。想要 “深入” 底层控制的程序员可以使用 Rust,无需冒着常见的崩溃或安全漏洞的风险,也无需学习时常改变的工具链的最新知识。其语言本身更是被设计为自然而然的引导你编写出在运行速度和内存使用上都十分高效的可靠代码。 已经在从事编写底层代码的程序员可以使用 Rust 来提升抱负。例如,在 Rust 中引入并行是相对低风险的操作:编译器会为你捕获经典的错误。同时你可以自信的采取更为积极的优化,而不会意外引入崩溃或漏洞。 但 Rust 并不局限于底层系统编程。其表现力和工效足以令人愉悦的编写出 CLI 应用、web server 和很多其他类型的代码 —— 在本书中你会看到两个简单示例。使用 Rust 能将你在一个领域中学习的技能延伸到另一个领域;你可以学习 Rust 来编写 web 应用,接着将同样的技能应用到你的 Raspberry Pi(树莓派)上。 本书全面介绍了 Rust 为用户赋予的能力。其内容平易近人,致力于帮助你提升 Rust 的知识,并且提升你作为程序员整体的理解与自信。那么让我们准备深入学习 Rust 吧(打开新世界的大门 :)) —— 欢迎加入 Rust 社区! — Nicholas Matsakis 和 Aaron Turon

最新发布 更多 ……

编程语言 Rust 实践收集

rust rust-guide rust-实践

本书侧重于实践,通过以下实践过程体现目标。 - 聚焦重要的主题,展示可能的解决方案,提供一个跳板引导读者进入一些更高级的内容(这些内容或许可以在网上或者参考手册中找到); - 以开发中遇到的实际应用问题为导向,以优雅的解决方案为目标,进行完整的实例实践解决方案; - 在实例实践过程中,引入解决方案所涉及的相关 crate,并进行实例开发展示。同时,若有同类 crate,则通过实践过程和实现效果进行比较; - 完整实例,可独立运行,也可整合于实际开发环境; - 对于实例开发中引入的 crate,同步更新于 crate 官方仓库,保持最新版本的深入实践。 本书是受到 rust-lang-nursery 团队的开源书籍项目《Cookin’ with Rust》启发而产生的,并且学习借鉴了它的目录结构。 本书具体内容还在规划中,并未确定。欢迎交流:ask@rusthub.org。

Web Rust Web 实践零散

rust rust-web rust-web-guide rust-web-零散

##### Rust Web 实践零散 目前,仅是个人 Rust Web 开发中的一些记录。 涵盖:Rust Web 生态中的 Tide、actix-web、Yew、async-graphql、surf、handlebars-rust、rhai、jsonwebtoken,以及 mongodb 等。 完整的内容,还在进一步规划和整理之中。 学以聚之,问以辩之。终日乾乾,与时偕行。

其它 Markdown 指南

markdown markdown-guide markdown-指南

Markdown 是一种在 web 上设置文本样式的方法:使用普通文本编辑器编写的标记语言,通过简单的标记语法,它可以使普通文本内容具有一定的格式。 你可以使用 Markdown 对文档的展示格式进行排版:如将文本格式化为粗体或斜体、添加图像,以及创建列表等。大多数情况下,Markdown只是一些普通文本加上一些非字母字符,比如 # 或者 *。 Markdown 文档可以通过一些如 mdBook、gitBook 等应用转换为 HTML、PDF、DOC 等格式,提供给不同的应用场景。 Markdown 的语法简洁明了、学习容易,而且功能比纯文本更强,因此使用非常广泛。如 GitHub、WordPress 等,使用 Markdown 对平台上的写作形式进行样式化,提供了 Markdown 文档直接展示的功能。

其它 mdBook 中文指南/文档

markdown mdbook-guide mdbook-documentation mdbook-指南/文档

mdbook,从 markdown 文件生成书籍。就像 Gitbook, 但专为 Rust 设计。 mdBook 是一个命令行工具,可以将 Markdown 文档,变成 HTML 网站。 这样的工具,用在产品信息或是 API 文档, 教程, 课件资料等等场景。 - 轻量级: Markdown 语法 - 搜索: 集成 search 功能 - 语法高亮: syntax highlighting - 多个主题: Theme 自定义输出的格式 - 预先处理器: Preprocessors 预处理的扩展,比如 - 后端: Backends 选择输出的渲染格式 - 自然,还具有 Rust 加持,速度杠杠的。 - 甚至,Rust 代码 的自动测试。 本指南,带你进入,快进快出的现代化文档工具。 mdBook 是 Rust 官方的项目, 还有 The Rust Programming Language 等也是使用 mdBook 工具的。

编程语言 Rust 版本指南

rust rust-版本指南 rust-edition-guide

欢迎来到 Rust 版本(Edition)使用指南! “Editions” 是通过编写 Rust 代码来传达巨大改变的一种方式。 Rust 版本指南详细介绍了 Rust Edition 的有关信息,Rust 通过 Edition 机制保证稳定性版本前进,让程序在 2015、2018 以及未来的 2021 和 2024 版都能够顺利编译通过。 在指南中,我们将讨论: - 什么是版本(editions) - 每个版本什么样 - 如何将你的代码从一个版本迁移到另一个版本 请注意,标准库随每个Rust版本的增长而增长; 标准库中有许多添加的内容,本指南未对其进行说明。 只包含那些主要的变化,当然同时也有大量的中小型的改变也很棒。 您可能还想查看标准库文档。

Web Async-graphql 手册(Rust 的 GraphQL 服务器)

rust graphql-rust graphql-server graphql-服务器 async-graphql-book async-graphql-手册

Async-graphql是用Rust语言实现的GraphQL服务端库。它完全兼容GraphQL规范以及绝大部分的扩展功能,类型安全并且高性能。 你可以用Rust语言的方式来定义Schema,过程宏会自动生成GraphQL查询的框架代码,没有扩展Rust的语法,意味着Rustfmt可以正常使用,我很看重这一点,这也是为什么我会开发Async-graphql的原因之一。

Web Juniper 手册(Rust 的 GraphQL 服务器)

rust graphql-rust graphql-server graphql-服务器 juniper-book juniper-手册

Juniper 是 Rust 语言的 GraphQL 服务器库,用最少量的样板文件和配置构建类型安全且快速的 API 服务器。 GraphQL 是Facebook开发的一种数据查询语言,旨在为移动和 Web 应用程序前端提供服务。 Juniper 使得以 Rust 语言编写类型安全且速度惊人的 GraphQL 服务器成为可能,我们还尝试尽可能方便地声明和解析 GraphQL 模式。 Juniper 不包含 Web 服务器,仅提供了构建快,使得其与已有服务器的集成简单明了。Juniper 可选地为 Hyper、Iron、Rocket,以及 Warp等框架提供了预构建集成,并嵌入了 Graphiql,以便于调试。 #### 特点 Juniper 根据 GraphQL 规范定义支持完整的 GraphQL 查询语言,包括:接口、联合、模式内省,以及验证。但是不支持模式语言。 Juniper 作为 Rust 语言的 GraphQL 库,默认构建非空类型。类型为 Vec\<Episode\> 的字段将被转换为 \[Episode!\]!,相应的 Rust 语言类型则为 Option\<Vec\<Option\<Episode\>\>\>。

编程语言 Rust 秘典(死灵书)

rust rust-秘典 rust-死灵书 rust-nomicon rustonomicon

《Rust 秘典》是 Unsafe Rust 的黑魔法指南。它有时被称作“死灵书”。 Rust 秘典挖掘了你在编写不安全 Rust 程序时需要了解的所有可怕的细节。 如果你希望在编写 Rust 程序的过程中获得长久而快乐的职业生涯,你应该现在回头,忘记你曾经看过这本书。 它没有必要。 然而,如果你打算编写不安全代码——或者只是想深入了解语言的内涵——这本书包含了很多有用的信息。 与 The Rust Programming Language 不同的是,我们将假设你有相当多的前期知识。 特别是,你应该对基本的系统编程和 Rust 非常熟悉。 如果你对这些主题感到困惑,你应该考虑先阅读The Book。 也就是说,我们不会假定你已经读过了,而且我们会注意偶尔在适当的时候对基础知识进行复习。 如果你想的话,你可以直接跳过The Book来看这本书:但你需要知道我们不会从头到尾地详细解释一切。 本书主要是作为The Reference的高级配套读物而存在。 《The Reference》的存在是为了详细说明语言的每一部分的语法和语义,而《Rust 秘典》的存在是为了描述如何将这些部分结合起来使用,以及你在这样做时将会遇到的问题。

编程语言 Cargo 手册

rust cargo cargo-book cargo-手册

Cargo 是 [Rust](https://rust-lang.niqin.com/zh-cn) 的[包管理器和构建系统](https://cargo-book.niqin.com/zh-cn/appendix/glossary.html#package-manager '"package manager" (glossary entry)')。Cargo 会下载你的 Rust [包](https://cargo-book.niqin.com/zh-cn/appendix/glossary.html#package '"package" (glossary entry)')依赖项,编译您的包,生成可分发的包,并将它们上传到 [crates.io](https://crates.io/) - Rust 社区的 *[包注册表](https://cargo-book.niqin.com/zh-cn/appendix/glossary.html#package-registry '"package registry" (glossary entry)')*。 Cargo 手册是使用 Cargo 全面指南教程,Cargo 是 Rust 的包管理器,通过本手册全面了解如何构建 Rust 程序和大型项目。

编程语言 Rust 参考手册

rust rust-reference rust-参考手册

《Rust 参考手册》并非正式的语言规范,但它比“圣经”更加详尽而全面。 本书是 Rust 编程语言的主要参考手册,本书提供了3类资料: - 一些章节非正式地介绍了该语言的各种语言结构及其用法。 - 一些章节非正式地介绍了该语言的内存模型、并发模型、运行时服务、链接模型,以及调试工具。- - 附录章节提供了一些对 Rust 语言有影响的编程原理和参考资料。 ### 警告: - 此书尚未完成,记录 Rust 的所有内容需要花些时间。 - Rust 参考手册是 Rust 官方编写的 Rust 语言规范手册,由于语言还在快速迭代当中,所以本手册的内容还未固定下来。但这是一本学习和了解 Rust 全面的语言特性必不可少的书籍。

编程语言 Rust Cookbook 中文版

rust rust-cookbook rust-code-examples rust-示例

《Rust Cookbook 中文版》: - * 是 Rust 程序设计语言([Rust 官方教程简体中文版](https://rust-lang.niqin.com/zh-cn))的简要实例示例集合; * 展示了在 Rust 生态系统中,使用各类 crate 来完成常见编程任务的良好实践。 了解更多关于《Rust Cookbook 中文版》一书的信息,请阅读[关于本书](https://rust-cookbook.niqin.com/zh-cn/about.html),包括:如何阅读本书的提示、如何使用实例示例,以及关于注释的约定。

Web Tide 中文文档

rust rust-web tide web-framework

Tide 是小型而实用的 Rust web 应用程序框架,为快速开发而构建。它提供了一组健壮的特性,使得构建异步 web 应用程序和 API 更加容易、更为有趣。 Tide 指导手册正在编写中,会随着实践的推移逐步完善。 本书中所有的实例请参阅 [Tide 实例项目](https://github.com/http-rs/tide-book/tree/main/examples)。 > 💥 Tide 在\*\*生产环境的实践“脚手架”\*\*项目,请参阅 **[surfer](https://github.com/zzy/surfer)**[(github 仓库)](https://github.com/zzy/surfer)(将持续升级): > > - 纯粹 Rust 技术栈实现的博客系统,有兴趣请访问[演示站点 1](https://niqin.com),以及[演示站点 2](https://gaidun.com):。 > - 后端(backend)主要提供 graphql 服务,使用了 tide, async-graphql, jsonwebtoken, mongodb 等相关 crate。 > - 前端(frontend)提供 web 应用服务,使用了 tide, rhai, surf, graphql_client, handlebars-rust, cookie 等相关 crate。 > > 💥 关于清洁的模板项目,采用了**纯粹的 Rust 技术栈**。包括(将持续升级): > > - [Rust](https://www.rust-lang.org) - [中文文档](https://rust-lang.niqin.com) > - [Tide](https://crates.io/crates/tide) - [中文文档](https://tide-book.niqin.com) > - [async-graphql](https://crates.io/crates/async-graphql) - [中文文档](https://async-graphql.niqin.com) > - [mongodb & mongo-rust-driver](https://crates.io/crates/mongodb) > - [Surf](https://crates.io/crates/surf) > - [graphql_client](https://crates.io/crates/graphql_client) > - [handlebars-rust](https://crates.io/crates/handlebars) > - [jsonwebtoken](https://crates.io/crates/jsonwebtoken) > - [cookie-rs](https://crates.io/crates/cookie) > > 最简单但完全的示例项目,请参阅 github 仓库 **<a href="https://github.com/zzy/tide-async-graphql-mongodb">tide-async-graphql-mongodb</a>**。目前实现了如下功能(将持续升级): > > - 用户注册 > - 使用 PBKDF2 对密码进行加密(salt)和散列(hash)运算 > - 整合 JWT 鉴权的用户登录 > - 密码修改 > - 资料更新 > - 用户查询和变更 > - 项目查询和变更 > - 使用基于 Rust 实现 graphql-client 获取 GraphQL 服务端数据 > - 渲染 GraphQL 数据到 handlebars-rust 模板引擎

编程语言 通过例子学 Rust

rust rust-examples rust-by-example

Rust 是一门注重安全(safety)、速度(speed)和并发(concurrency)的现代系统编程语言。Rust 通过内存安全来实现以上目标,但不使用垃圾回收机制(garbage collection, GC)。 《通过例子学 Rust》(Rust By Example, RBE)内容由一系列可运行的实例组成,通过这些例子阐明了各种 Rust 的概念和基本库。想获取这些例子外的更多内容,不要忘了安装 Rust 到本地并查阅官方标准库文档。另外为了满足您的好奇心,您还可以查阅本网站的源代码。 现在让我们开始学习吧! * Hello World - 从经典的 “Hello World” 程序开始学习。 * 原生类型 - 学习有符号整型,无符号整型和其他原生类型。 * 自定义类型 - 结构体 struct 和 枚举 enum。 * 变量绑定 - 变量绑定,作用域,变量遮蔽。 * 类型系统 - 学习改变和定义类型。 * 类型转换 * 表达式 * 流程控制 - if/else,for,以及其他流程控制有关内容。 * 函数 - 学习方法、闭包和高阶函数。 * 模块 - 使用模块来组织代码。 * Crate - crate 是 Rust 中的编译单元。学习创建一个库。 * Cargo - 学习官方的 Rust 包管理工具的一些基本功能。 * 属性 - 属性是应用于某些模块、crate 或项的元数据(metadata)。 * 泛型 - 学习编写能够适用于多种类型参数的函数或数据类型。 * 作用域规则 - 作用域在所有权(ownership)、借用(borrowing)和生命周期(lifetime)中起着重要作用。 * 特性 trait - trait 是对未知类型(Self)定义的方法集。 * 宏 * 错误处理 - 学习 Rust 语言处理失败的方式。 * 标准库类型 - 学习 std 标准库提供的一些自定义类型。 * 标准库更多介绍 - 更多关于文件处理、线程的自定义类型。 * 测试 - Rust 语言的各种测试手段。 * 不安全操作 * 兼容性 * 补充 - 文档和基准测试

编程语言 Rhai - Rust 的嵌入式脚本语言

rust rhai embedded-scripting embedded-scripting-for-rust

Rhai is an embedded scripting language and evaluation engine for Rust that gives a safe and easy way to add scripting to any application. Targets and builds - * All CPU and O/S targets supported by Rust, including: * WebAssembly (WASM) * `no-std` * Minimum Rust version 1.57 Standard features - * Simple language similar to JavaScript+Rust with dynamic typing. * Fairly efficient evaluation (1 million iterations in 0.3 sec on a single-core, 2.3 GHz Linux VM). * Tight integration with native Rust functions and types, including getters/setters, methods and indexers. * Freely pass Rust values into a script as variables/constants via an external Scope - all clonable Rust types are supported; no need to implement any special trait. Or tap directly into the variable resolution process. * Built-in support for most common data types including booleans, integers, floating-point numbers (including Decimal), strings, Unicode characters, arrays (including packed byte arrays) and object maps. * Easily call a script-defined function from Rust. * Relatively little unsafe code (yes there are some for performance reasons). * Few dependencies - currently only smallvec, num-traits, ahash, bitflags and smartstring. * Re-entrant scripting engine can be made Send + Sync (via the sync feature). * Compile once to AST form for repeated evaluations. * Scripts are optimized (useful for template-based machine-generated scripts). * Easy custom API development via plugins system powered by procedural macros. * Function overloading and operator overloading. * Dynamic dispatch via function pointers with additional support for currying. * Closures (anonymous functions) that can capture shared values. * Some syntactic support for object-oriented programming (OOP). * Organize code base with dynamically-loadable modules, optionally overriding the resolution process. * Serialization/deserialization support via serde (requires the serde feature). * Support for minimal builds by excluding unneeded language features. * A debugging interface. Protected against attacks - * Don't Panic guarantee - Any panic is a bug. Rhai subscribes to the motto that a library should never panic the host system, and is coded with this in mind. * Sand-boxed - the scripting engine, if declared immutable, cannot mutate the containing environment unless explicitly permitted. * Rugged - protected against malicious attacks (such as stack-overflow, over-sized data, and runaway scripts etc.) that may come from untrusted third-party user-land scripts. * Track script evaluation progress and manually terminate a script run. * Passes Miri. For those who actually want their own language - * Use as a DSL. * Disable certain language features such as looping. * Further restrict the language by surgically disabling keywords and operators. * Define custom operators. * Extend the language with custom syntax.