How to gain expertise in rust
There are few topics in Rust that we should cover:
https://doc.rust-lang.org/book/The first few chapters cover ownership, borrowing/aliasing and mutability. And the general syntax of Rust, such as
struct,enums,match,if let, references.The next thing that we can focus on is smart pointers: Unsafecell, Cell, RC, Refcell. One great video on how these smart pointers work internally is https://www.youtube.com/watch?v=8O0Nt9qY_vo. Also refer to the smart pointer section in the rust book, It tells how to deal with the referential cycle that can be introduced with the usage of
rcandrefcell. To avoid these cycles, we can downgradercto a weak reference where the weak count doesn’t influence the dropping ofrc.Next, I would recommend going over the zero to prod rust book. It covers topics such as different cargo utilities, such as tarpaulin, clippy, rustfmt, cargo expand. Then it creates newletter using actix-web framework, then how to connect to chose DB and use it for your project, it explores compilation-time sql validation, async nature and DSL free sqlx package. And it explores how to properly generate logs, how to use tracing so that there is correlation between different logs for a single task. At the end of the book, you will have a working rust application while covering different areas of managing, writing, and deploying a rust application.
Subtyping and variance: how Rust allows usage of long lifetime where a function expects a short lifetime. What covariance, invariance, and contravariance is, and where we find usecases for these specific topics. https://www.youtube.com/watch?v=iVYWDIW71jk
The next thing that I will argue you focus on is low-level programming, like WASM and learning about Nonnull, PhantomData and very nuanced things in Rust, which will be used in low-level programming. This will provide you with a better opportunity to learn about this language and also improve your skill set in Rust, helping you work on the things that Rust was meant to work on.
learn about atomics, mutexes, what is lock-free, thread parking and how a thread can yield control? What is memory order? Different types of ordering with different guarantees. https://www.youtube.com/watch?v=rMGWeSjctlY&t=251s. How to use thread::park and condvar to wait and notify other threads. Read atleast firstly 3 chapters of https://mara.nl/atomics/preface.html. https://en.cppreference.com/cpp/atomic/memory_order#Release-Acquire_ordering
How to write code for a microcontroller without support for std and operating system. Compressing and optimizing the size of binary with opt-levels. What is RTT, what is serial port like UART, I2C for communicating with sensors. Bluetooth light protocols.
Links:
https://rust-lang.guide/ - Explore more on how you can continue your Rust journey and what topics you can explore and learn more about.