学习建议
学 Rust 的误区:https://dystroy.org/blog/how-not-to-learn-rust/
基础
Learn Rust iterator methods via emoji:https://github.com/heavypackets/rust-iterator-emoji
默认参数在 Rust 中的实现:https://medium.com/@softprops/default-values-copy-that-ae43831781f3
reference
❤ (im)mutable or shared/exclusive: https://docs.rs/dtolnay/0.0.9/dtolnay/macro._02__reference_types.html
- https://doc.rust-lang.org/std/cell/index.html
https://limpet.net/mbrubeck/2019/02/07/rust-a-unique-perspective.html
borrow trait
borrow trait / asref trait / deref trait:
- ❤ Rust 概念解惑 | Deref vs AsRef vs Borrow vs Cow:https://mp.weixin.qq.com/s/OdcLb5U8QCeYH08feThN7w
- http://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/first-edition/borrow-and-asref.html
- https://www.reddit.com/r/rust/comments/ex50zg/difference_among_deref_borrow_and_asref/
- borrow trait 例子:http://idubrov.name/rust/2018/06/01/tricking-the-hashmap.html
rust之Rc、Weak:https://fugangqiang.github.io/posts/rust/rust%E4%B9%8BRc%E3%80%81Weak.html
trait
Rust std 标准库 trait 详解:https://github.com/pretzelhammer/rust-blog/blob/master/posts/tour-of-rusts-standard-library-traits.md
trait object
Storing unboxed trait objects in Rust: https://guiand.xyz/blog-posts/unboxed-trait-objects.html
A Quick Look at Trait Objects in Rust (February 12 2019): https://tratt.net/laurie/blog/entries/a_quick_look_at_trait_objects_in_rust.html
lifetime 生命周期
Rust 常见 lifetime 误解:https://github.com/pretzelhammer/rust-blog/blob/master/posts/common-rust-lifetime-misconceptions.md
Crust of Rust - Lifetime Annotations https://www.youtube.com/watch?v=rAl-9HwD858
所有权
如何理解Rust中的可变与不可变?:https://rustcc.cn/article?id=37d1cb4f-5cc9-4adc-b41a-dbe4914bf4b5
pattern
A catalogue of Rust design patterns, anti-patterns and idioms:https://rust-unofficial.github.io/patterns/
marco
官方介绍:
https://doc.rust-lang.org/book/macros.html
https://doc.rust-lang.org/rust-by-example/macros.html
https://doc.rust-lang.org/reference/macros.html- The Little Book of Rust Macros(新版,由新的作者维护更新。非常系统而详细地介绍了声明宏,提供十分详尽的案例,娓娓道来):https://zjp-cn.github.io/tlborm
- https://github.com/rust-lang/rust/blob/1.0.0/src/libsyntax/ext/tt/macro_parser.rs
- https://stackoverflow.com/questions/26731243/how-do-i-use-a-macro-across-module-files
- https://blog.turbo.fish/
- 过程宏学习资料+完整项目:https://github.com/dtolnay/proc-macro-workshop
【中文】过程宏笔记:http://blog.ideawand.com/、(视频)https://space.bilibili.com/500416539/video (2021.2.3文章)https://blog.logrocket.com/macros-in-rust-a-tutorial-with-examples
错误处理
[Rust Official Blog] Error Handling Project Group:
- Error Handling in Rust (2015, by burntsushi):https://blog.burntsushi.net/rust-error-handling/
中文版:Rust 中的错误处理 - Rust Error Handling (2021.12):https://www.unwoundstack.com/blog/rust-error-handling.html
其他文章
- Rust: Structuring and handling errors in 2020:https://nick.groenen.me/posts/rust-error-handling/
- Ergonomic error handling with Rust (2021.04):https://dev.to/senyeezus/ergonomic-error-handling-with-rust-13bj
lint
https://doc.rust-lang.org/stable/unstable-book/language-features/plugin.html并发
https://zhuanlan.zhihu.com/p/365905573异步
- 【Rust每周一知】Rust 异步入门:https://rustcc.cn/article?id=0117ce5f-2c89-49bf-8b06-82bf66acf936
- https://fasterthanli.me/articles/pin-and-suffering
- https://ryhl.io/
- 官方书籍(更新中):https://github.com/rust-lang/async-book
go | io_uring: http://icebergu.com/
closure 闭包
https://zhauniarovich.com/post/2020/2020-12-closures-in-rust/
Why Rust Closures are (Somewhat) Hard:https://stevedonovan.github.io/rustifications/2018/08/18/rust-closures-are-hard.html
iterator 迭代器
Rust iterators tips and tricks:https://robinmoussu.gitlab.io/blog/post/2021-03-25_rust_iterators_tips_and_tricks/
❤ Rust 1.17.0, Itertools 0.6.0. 方法最简注解:https://danielkeep.github.io/itercheat_baked.html
Rust:知识图内存
Rust Memory Container Cheat-sheet:https://github.com/usagi/rust-memory-container-cs
- 透过 Rust 探索系统的本原:RAII https://mp.weixin.qq.com/s/jaKjzc_1rkDe67rfpnFTgg
字符串
- https://www.brandons.me/blog/why-rust-strings-seem-hard
Optimising string processing in Rust
Box
https://nilstrieb.github.io/posts/box-is-a-unique-type/
nostd
嵌入式设备使用 std 记录:https://timmmm.github.io/std-embedded-rust/
unsafe
https://rust-lang.github.io/unsafe-code-guidelines/introduction.html
newtype
When Zero Cost Abstractions Aren’t Zero Cost (当零成本抽象不再是零成本): https://blog.polybdenum.com/2021/08/09/when-zero-cost-abstractions-aren-t-zero-cost.html
benchmark
cargo 自带的 bench 还未稳定:https://doc.rust-lang.org/stable/unstable-book/library-features/test.html
- 三方 bench crate:https://github.com/bheisler/criterion.rs