Rust Learn
A repo to learn rust.
This main branch is a standard template for new rust project!
Learning Resource
Learn Rust with:
- 《Rust 程序设计语言(第二版) 简体中文版》
- 《Rust语言圣经(Rust Course)》
- 《rust-by-example》
- 《too-many-lists》
- 《Rusty Book》
- 《Rust 秘典(死灵书)》
- 《The Little Book of Rust Macros (Rust 宏小册)》
Exercises:
Gitbook Url:
Jupyter
The Jupyter branch is shown below (Which helps you run Rust as script!):
Which depend on jupyter kernel:
Create Project
Use Cargo to create a project:
cargo new hello_rust --bin
build:
cd hello_rust && cargo build --release
run:
./target/release/hello_rust
Hello, world!
Or just run program with:
cargo run
Now Finished
Project | Date | Note | Linked Blog |
---|---|---|---|
chapter2-guessing-game | 2021-06-01 | A guessing game | |
chapter3-variables | 2021-06-02 | Variable & Type | |
multiple-main-demo | 2021-06-02 | A demo to show how to run multiple main | |
chapter4-function | 2021-06-02 | Function | |
chapter5-control-flow | 2021-06-02 | Control flow(if/loop/while/for) | |
chapter6-ownership | 2021-06-03 | Ownership(also string/slice) | |
chapter7-struct | 2021-06-04 | Struct | |
chapter8-enum-and-match | 2021-06-07 | Enum & Match | |
chapter9-modules | 2021-06-07 | Modules(mod/pub/use/super) | |
chapter10-collections | 2021-06-09 | Vector & String & Map | |
chapter11-error-handling | 2021-06-09 | Error handling (Panic! & Result) | |
chapter12-generic-trait-lifetime | 2021-06-10 | Generic & Trait & Lifetime | |
chapter13-testing | 2021-06-12 | Testing(Write, Run & Organize) | |
chapter14-io-project-grep | 2021-06-13 | A io project: mini-grep written in rust. |
|
chapter15-functional-features | 2021-06-14 | Functional features(Closure & Iterator) in rust. | |
chapter16-cargo | 2021-06-15 | Cargo(Config, Publish, Install & Extend) & Workspace in rust. | |
chapter17-smart-pointer | 2021-09-29 | Smart Pointer(Within double-linked-list accomplishment). | |
chapter18-concurrency | 2021-10-03 | Concurrency. | |
chapter19-oop | 2021-11-14 | Object-Oriented-Programming. | |
chapter20-match-patterns | 2021-11-14 | The Match Patterns. | |
chapter21-advanced-features | 2021-11-14 | The advanced features: Unsafe、Lifetime、Trait、Type、Function & Closure |
|
actix-web-demo | 2021-10-04 | RESTful API accomplished by actix-web framework. | |
rbatis-demo | 2021-10-07 | A demo to show how to use ORM framework: rbatis | |
wasm-hello | 2021-10-09 | A simple rust-wasm demo.[Use template: wasm-pack-template] | 《Rust实现WebAssembly初窥》 |
feature-phantom | 2021-10-19 | A demo to show how to use PhantomData beautify your code |
《Rust中的PhantomType》 |
url-mapper-rs | 2021-12-04 (2021-12-21 Last Updated) |
A simple URL Mapper service built | 《Building a Web Application with Rust》 |
algorithm | 2021-12-22 | Collect lots of algorithm & data structures(Such as: LinkedList, …) | |
too-many-lists | 2022-01-05 | A accomplishment for Learn Rust With Entirely Too Many Linked Lists | |
ffi-demo | 2022-01-17 | A FFI(Foreign Function Interface) demo according to: https://nomicon.purewhite.io/ffi.html |
|
hot-reload | 2022-08-10 | A demo to show hot-reload. Reference: https://robert.kra.hn/posts/hot-reloading-rust/ |
|
tokio | 2022-11-01 | A branch to learn tokio | |
recover | 2022-11-17 | A branch to show how rust recovered from panic | 《Rust从panic中恢复》 |
build-version | 2022-11-17 | A branch to use build.rs add commit version for binary executable |
《为Cargo编译的可执行文件增加commit版本号》 |
error | 2022-11-18 | A branch to show error handle | 《Rust中的错误处理》 |
project-structure | 2022-11-19 | A branch to show how rust project structure organized | 《Rust模块组织结构》 |
default-and-with | 2022-11-19 | Use Default or With Trait to initiate item | 《Rust中的默认初始化和初始化重载》 |
cargo | 2022-11-23 | A branch to learn cargo | 《Cargo命令及其扩展》 |
compare | 2022-11-23 | A branch to show how PartialEq/Ord, Eq/Ord works | 《Rust中的比较》 |
any | 2022-11-25 | A branch to show reflection via Any | 《Rust反射之Any》 |
reflection | 2022-11-25 | A branch to show reflection via proc-macros | 《Rust反射之过程宏》 |
cargo-features | 2022-11-28 | A branch to show cargo features | 《通过一个例子学习Cargo-Features》 |
future | 2022-11-29 | A branch to show how to use future and how it works | 《Rust中Future执行底层探秘》 |
grpc | 2022-12-03 | A branch to show how to use grpc via tonic | 《Rust的GRPC实现Tonic》 |
Serial Project
url-mapper-rs
Project Space:
Learning Step:
- Part I : Configuration
- Part II : Database Setup
- Part III - Database Manager: add mapper & tokio-async
- Part IV: Basic Server & log tracing
- Part V: Server and Database Manager communication
- Part VI - UrlMap CRUD API
- Part VII - Auth Middleware
- Part VIII - Containerization
- Part IX - Handling Signals & Deploying to Kubernetes
- Part X - Frontend using Tera
- Part XI - React Front-End
algorithm
Project Space:
Learning Step:
Not Yet!