Code This branch is1 commit ahead of,242 commits behindrust-lang-cn/rust-by-example-cn:master. 通过例子学 Rust Chinese translation of theRust By Example 本文档按照Rust 文档翻译指引规范进行翻译。 首次于 2016-08-07 翻译完全部内容,欢迎纠正——最后更新时间 2019.5.3 近段时间将跟随英文版进行升级...
Below is an example of Rust code that exposes a QObject with two properties and four invokable methods to Qt.```rust use cxx_qt::make_qobject;const DEFAULT_STR: &str = r#"{"number": 1, "string": "Hello World!"}"#;#[make_qobject]...
- While Loops: Repeat a block of code while a condition is true. - For Loops: Iterate over items in a collection or a range. ## Creating Functions Functions in Rust are defined using the `fn` keyword. They can take parameters and return values: rust fn add(a: i32, b: i32) -> ...
Download the example code files Download the color images Conventions used Get in touch Reviews Basics of Rust Getting to know Rust Installing Rust Windows Linux/Mac Test your installation Documentation and reference Main function Variables Built-in data types Integer types Floating-point types Boolean...
Download the example code files Download the color images Conventions used Get in touch Reviews Basics of Rust Getting to know Rust Installing Rust Windows Linux/Mac Test your installation Documentation and reference Main function Variables Built-in data types Integer types Floa...
Rust JSON Example: Serialize and Deserialize JSON The next step is to create a program that can serialize and deserialize the JSON data using the serde_json package. Edit the “main.rs” file in the src folder and add the source code as shown in the following: ...
docker-run-rustc-1cpu.sh: with 1 CPU, 2 GB of RAM, docker-run-rustc-2cpu.sh: with 2 CPUs, 2 GB of RAM, docker-run-rustc-4cpu.sh: with 4 CPUs, 3 GB of RAM, docker-run-rustc-8cpu.sh: with 8 CPUs, 5 GB of RAM, ...
fnmain() { // Line comments which go to the end of line. // 行内注释 直到本行结束 /* block comments which go to the closing delimiter. */ /* 块注释 直到块注释符结束 这一大块都是注释 */ println!("Hello, world!"); println!("I'm a Rustacean!"); ...
内容 隐藏 1 Rust 编程实例 2 Rust Programming By Example Rust 编程实例 Rust Programming By Example 通过构建引人入胜的、并发的、反应式的和健壮的应用程序进入 Rust
The following tutorial implements a REST API server using the Rust Diesel ORM. The scenario is that of an e-commerce application where database access is managed using the Entity Framework Core.The source for the application can be found in the Using ORMs with YugabyteDB repository....