NiQin shared an aphorism: 为何天意总让年轻人承载悲痛?我不知道。但我想年龄会加深所有的情感,包括悲痛。 -- 电影《利刃出鞘》
All - Latest Recommended Latest Sticky Create new Book/Doc My Books/Docs
All rights of books and documents belong to the authors, editors, and translators, the goal of this site is to facilitate reading. If there is anything improper, please contact ask@rusthub.org.

Web The Hitchhiker's Guide to Rust Web No.633e770a1f92fec312176c4f Sticky Recommended

NiQin updated at 2022-10-06 14:34:50+08:00

Hits: 50868

Keys/tags: rust rust-web rust-web-guide rust-web-零散

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

Programming Languages The Cargo Book No.6333f9194cf3e9b0651d373b Sticky

NiQin updated at 2022-09-28 15:34:49+08:00

Hits: 107259

Keys/tags: rust cargo cargo-book cargo-手册

Cargo is the [Rust](https://rust-lang.niqin.com/en-us)'s *[package manager](https://cargo-book.niqin.com/en-us/appendix/glossary.html#package-manager '"package manager" (glossary entry)')*. Cargo downloads your Rust [package](https://cargo-book.niqin.com/en-us/appendix/glossary.html#package '"package" (glossary entry)')’s dependencies, compiles your packages, makes distributable packages, and uploads them to [crates.io](https://crates.io/), the Rust community’s *[package registry](https://cargo-book.niqin.com/en-us/appendix/glossary.html#package-registry '"package registry" (glossary entry)')*. A book on Rust’s package manager and build system.

Programming Languages The Rustdoc book No.6333ec894cf3e9b0651d3731 Sticky

NiQin updated at 2022-09-28 14:41:13+08:00

Hits: 35613

Keys/tags: rust rustdoc rustdoc-book rustdoc-手册 rust-crate-文档

Learn how to make awesome documentation for your crate. The standard Rust distribution ships with a tool called `rustdoc`. Its job is to generate documentation for Rust projects. On a fundamental level, Rustdoc takes as an argument either a crate root or a Markdown file, and produces HTML, CSS, and JavaScript.

Programming Languages Rust Cookbook No.6332e3874cf3e9b0651d3723 Sticky Recommended

NiQin updated at 2022-09-27 19:50:31+08:00

Hits: 75681

Keys/tags: rust rust-cookbook rust-code-examples rust-示例

This *Rust Cookbook*: - * Is a collection of simple examples; * That demonstrate good practices to accomplish common programming tasks, using the crates of the Rust ecosystem. [Read more about ](https://rust-cookbook.niqin.com/en-us/about.html)*[Rust Cookbook](https://rust-cookbook.niqin.com/en-us/about.html)*, including tips for how to read the book, how to use the examples, and notes on conventions.

Web Tide book No.62e28db6bfb6201b26c9d42a Sticky

NiQin updated at 2022-07-28 21:23:02+08:00

Hits: 49143

Keys/tags: rust rust-web tide web-framework

Tide is a minimal and pragmatic Rust web application framework built for rapid development. It comes with a robust set of features that make building async web applications and APIs easier and more fun. This Tide-book is still a work in progress, and will be expanded on over time. All examples in the text are available as [working Tide-projects](https://github.com/http-rs/tide-book/tree/main/examples) Example applications: - [tide-async-graphql-mongodb](https://github.com/zzy/tide-async-graphql-mongodb) - Clean boilerplate for graphql services using tide, rhai, async-graphql, surf, graphql-client, handlebars-rust, jsonwebtoken, and mongodb. - Graphql Services: User register, Salt and hash a password with PBKDF2 , Sign in, JSON web token authentication, Change password, Profile Update, User's query & mutation, and Project's query & mutation. - Web Application: Client request, bring & parse GraphQL data, Render data to template engine(handlebars-rust), Define custom helper with Rhai scripting language. - [surfer](https://github.com/zzy/surfer) - The Blog built on Tide stack, generated from [tide-async-graphql-mongodb](https://github.com/zzy/tide-async-graphql-mongodb). - Backend for graphql services using tide, async-graphql, jsonwebtoken, mongodb and so on. - Frontend for web application using tide, rhai, surf, graphql_client, handlebars-rust, cookie and so on.

Programming Languages Rust by Example No.627bccff7e84024c6ea0739a Sticky Recommended

NiQin updated at 2022-05-11 22:49:35+08:00

Hits: 102195

Keys/tags: rust rust-examples rust-by-example

Rust is a modern systems programming language focusing on safety, speed, and concurrency. It accomplishes these goals by being memory safe without using garbage collection. Rust by Example (RBE) is a collection of runnable examples that illustrate various Rust concepts and standard libraries. To get even more out of these examples, don't forget to install Rust locally and check out the official docs. Additionally for the curious, you can also check out the source code for this site. Now let's begin! * Hello World - Start with a traditional Hello World program. * Primitives - Learn about signed integers, unsigned integers and other primitives. * Custom Types - struct and enum. * Variable Bindings - mutable bindings, scope, shadowing. * Types - Learn about changing and defining types. * Conversion * Expressions * Flow of Control - if/else, for, and others. * Functions - Learn about Methods, Closures and High Order Functions. * Modules - Organize code using modules * Crates - A crate is a compilation unit in Rust. Learn to create a library. * Cargo - Go through some basic features of the official Rust package management tool. * Attributes - An attribute is metadata applied to some module, crate or item. * Generics - Learn about writing a function or data type which can work for multiple types of arguments. * Scoping rules - Scopes play an important part in ownership, borrowing, and lifetimes. * Traits - A trait is a collection of methods defined for an unknown type: Self * Macros * Error handling - Learn Rust way of handling failures. * Std library types - Learn about some custom types provided by std library. * Std misc - More custom types for file handling, threads. * Testing - All sorts of testing in Rust. * Unsafe Operations * Compatibility * Meta - Documentation, Benchmarking.

Programming Languages Rhai - Embedded Scripting for Rust No.627bca167e84024c6ea07392 Sticky

NiQin updated at 2022-05-11 22:37:10+08:00

Hits: 187611

Keys/tags: 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.

Programming Languages The Rust Programming Language No.627bc4107e84024c6ea07389 Sticky Recommended

NiQin updated at 2022-05-11 22:11:28+08:00

Hits: 118931

Keys/tags: rust rust-book empowerment 赋能

It wasn’t always so clear, but the Rust programming language is fundamentally about empowerment: no matter what kind of code you are writing now, Rust empowers you to reach farther, to program with confidence in a wider variety of domains than you did before. Take, for example, “systems-level” work that deals with low-level details of memory management, data representation, and concurrency. Traditionally, this realm of programming is seen as arcane, accessible only to a select few who have devoted the necessary years learning to avoid its infamous pitfalls. And even those who practice it do so with caution, lest their code be open to exploits, crashes, or corruption. Rust breaks down these barriers by eliminating the old pitfalls and providing a friendly, polished set of tools to help you along the way. Programmers who need to “dip down” into lower-level control can do so with Rust, without taking on the customary risk of crashes or security holes, and without having to learn the fine points of a fickle toolchain. Better yet, the language is designed to guide you naturally towards reliable code that is efficient in terms of speed and memory usage. Programmers who are already working with low-level code can use Rust to raise their ambitions. For example, introducing parallelism in Rust is a relatively low-risk operation: the compiler will catch the classical mistakes for you. And you can tackle more aggressive optimizations in your code with the confidence that you won’t accidentally introduce crashes or vulnerabilities. But Rust isn’t limited to low-level systems programming. It’s expressive and ergonomic enough to make CLI apps, web servers, and many other kinds of code quite pleasant to write — you’ll find simple examples of both later in the book. Working with Rust allows you to build skills that transfer from one domain to another; you can learn Rust by writing a web app, then apply those same skills to target your Raspberry Pi. This book fully embraces the potential of Rust to empower its users. It’s a friendly and approachable text intended to help you level up not just your knowledge of Rust, but also your reach and confidence as a programmer in general. So dive in, get ready to learn—and welcome to the Rust community! — Nicholas Matsakis and Aaron Turon