Ready to start your learning journey?
This guide is made by Glen De Cauwsemaecker and is in no way endorsed nor affiliated with the Rust foundation. Rust & Cargo are registered trademarks of the Rust foundation.
Rust, a modern systems programming language, prioritizes safety as a core attribute. Systems programming typically operates within resource-limited environments, much like our services running in pay-per-use cloud settings. This makes Rust highly suitable for more scenarios than one might initially consider.
As a contemporary language, Rust has learned from its predecessors, making it enjoyable to use once you've mastered its nuances. Its type system facilitates expressive coding, helping to eliminate a wide range of bugs beyond the advantages of static typing.
This guide aims to familiarize both individuals and organizations with Rust. If you need further assistance, Glen offers 1-on-1 coaching and organizational workshops. Please contact him at firstname.lastname@example.org. Additional details about Glen are available at https://glendc.com/.
This guide is entirely open-source, with the full source code accessible at https://github.com/plabayo/learn-rust-101. Should you discover any errors or have suggestions, kindly open an issue or submit a pull request. If you wish to contribute, please review the Contributing Guidelines. This guide, developed with affection by Plabayo, is licensed under the MIT License.
You might be wondering, why shall I learn Rust? In the About chapter you'll find plenty of reason to.
However, if you are a programmer coming from another language you might want to read the "Can Rust prevent logic errors?" article available at https://itsallaboutthebit.com/logic-errors-in-rust/# instead.
In the article "Can Rust prevent logic errors?" Piotr Sarnacki explores the potential of Rust, a programming language, to reduce software bugs, specifically logic errors. He highlights Rust's features such as the absence of nulls, the necessity to handle function errors, prevention of data races, and explicit marking of mutable variables.
Sarnacki contrasts Rust with Ruby, where runtime exceptions are common, suggesting that Rust allows for more stable applications. He discusses how Rust's expressiveness can help prevent some logic errors that might occur at runtime.
He also discusses how Rust's tools for managing data ownership and access control can prevent logic errors caused by unwanted mutations. Additionally, he emphasizes the use of enums in Rust to handle multiple options, which can prevent errors when dealing with multiple possible states.
In conclusion, Sarnacki believes that Rust offers many tools for writing correct software and its community's focus on correctness further enhances its value. Despite the potential for errors, he suggests that Rust has a relatively small amount of problematic features if misused.
Becoming proficient in Rust requires the fulfillment of three pillars:
- Pillar I: Learn Rust and get your foundations right
- Pillar II: Develop with Rust (Practical Experience)
- Pillar III: Be part of the Rust Ecosystem:
The sequence in which you approach each pillar is flexible—tailor it to your preference. While you may follow the steps as presented, this guide is best used as a reference and source of inspiration rather than a prescriptive manual.
These suggested paths highlight the versatility of this guide. The key is to enjoy the process and maintain consistent learning (e.g., approximately X hours per week). Your learning style and capabilities will dictate your journey and frequency of revisits. For instance, you might prefer to experiment with code before delving into the foundations, or you may want to fully grasp the basics before embarking on coding. The choice is yours.
However, one essential element is hands-on coding. Learning by doing is the most effective method. Don't shy away from making mistakes or trying new things—it will be a challenging but rewarding journey. Merely reading won't give you a true understanding of the language or its potential. So, engage in plenty of coding.
Even as you progress to advanced topics (e.g., Rust for Rustaceans), don't neglect the fundamentals. It's easy to forget what you've learned without regular practice. Thus, continue to balance basic and advanced studies—it's a continuous journey.
As you navigate this guide, you'll find alternative suggestions and varying levels of complexity. You might initially skim through a section, focusing on the foundational material, then revisit it later with more experience. This approach allows for spatial repetition, gradually shaping your understanding.
If you don't anticipate working on a project requiring Async programming soon, feel free to bypass that section for now. Just remember that Rust supports Async and it plays a significant role in the Rust ecosystem. You can always return to it when you're ready to strengthen your knowledge in this area.
Should you ever feel stuck or in need of a mentor, don't hesitate to contact Glen at email@example.com to arrange a one-on-one session or a workshop for your organization. Whether it's a one-off or regular meetings, assistance is readily available.
The origins of this guide can be found in the preparation of a semester long course I gave to a group of employees at OTA Insight Ltd.. The recordings of this course are available on YouTube at: https://www.youtube.com/playlist?list=PLQgXEsLXFxpVyLddG8FFXfNQEiodTzAjj. The videos are however not of the highest quality, especially given the many better resources out there.
Glen De Cauwsemaecker created this Educational track to help you get started with Rust from an absolute beginner all the way until you're an expert in it. He is open to mentor people, lead workshops and more. If you're a team lead that wants to introduce Rust to their team, feel free to talk to him. Glen started with Rust around 2015, when Rust was still unstable and fast moving. Coming from a C++ background in a system programming job the benefits were immediately clear to him. In the meanwhile things have changed a lot and many companies have been starting to adopt Rust in their toolset:
- Amazon Web Services (AWS) has used Rust since 2017 for its serverless computing offerings, AWS Lambda and AWS Fargate. With that, Rust has gained further inroads. The company has written the Bottlerocket OS and the AWS Nitro System to deliver its Elastic Compute Cloud (EC2) service.
- Cloudflare develops many of its services, including its public DNS, serverless computing, and packet inspection offerings with Rust.
- Dropbox rebuilt its backend warehouse, which manages exabytes of storage, with Rust.
- Google develops parts of Android, such as its Bluetooth module, with Rust. Rust is also used for the crosvm component of Chrome OS and plays an important role in Google's new operating system, Fuchsia.
- Google has also been teaching their engineers across the globe in Rust using their Comprehensive Rust learning material and they've written about these activities at length at https://security.googleblog.com/2023/09/scaling-rust-adoption-through-training.html.
- Meta uses Rust to power Meta's web, mobile, and API services, as well as parts of HHVM, the HipHop virtual machine used by the Hack programming language.
- Microsoft writes components of its Azure platform including a security daemon for its Internet of Things (IoT) service in Rust.
- Mozilla uses Rust to enhance the Firefox web browser, which contains 15 million lines of code. Mozilla's first two Rust-in-Firefox projects, its MP4 metadata parser and text encoder/decoder, led to overall performance and stability improvements.
- GitHub's npm, Inc., uses Rust to deliver "upwards of 1.3 billion package downloads per day."
- Oracle developed a container runtime with Rust to overcome problems with the Go reference implementation.
- Samsung, via its subsidiary SmartThings, uses Rust in its Hub, which is the firmware backend for its Internet of Things (IoT) service.
- The U.S. Department of Commerce's National Institute of Standards and Technology (NIST) has added Rust to its list of "Safer Languages" as part of its Software Assurance Metrics and Tool Evaluation (SAMATE).
Google also has a nice article about Facts and Debunked Myths about Rust which you can find at https://opensource.googleblog.com/2023/06/rust-fact-vs-fiction-5-insights-from-googles-rust-journey-2022.html (2022).
The language and its ecosystem have also very matured. Concepts like Async have also landed and Async runtimes such as Tokio have become stable and can be used without fear. While it was harder to convince companies to jump on the Rust wagon in the past, by now it should be a lot easier to sell. Is it one language to replace them all? Of course not, but neither should it be overlooked. Are you not sure how Rust might benefit your team for one thing or another? Contact Glen and figure it out together.
If you are a bit of a history nerd you might also enjoy:
- this article: How Rust went from a side project to the world's most-loved programming language
- or this podcast: History of Rust with Ben Striegel — Rustacean Station
There's a last section on the end of the Rust learning content. This one contains useful references and sources that you can check as part of your continuous journey as a capable Rust developer.
Not convinced yet? Read here what others have to say about Rust: https://brson.github.io/fireflowers/
You can support this gratis FOSS Rust Language guide by sharing it, contributing to it or help out financially.
This guide is free and will remain gratis available to share for all who are interested or until the overlords at GitHub pull it down.
🗞 This guide was featured on the front page of HackerNews on the 8th of April 2023 and in the weekly edition of the Rust newsletter on the 12th of April 2023.
Financially you can support this project by becoming a sponsor.
GitHub sponsors can be a one-time thing or regular financial contributors.
Or you can choose to buy me a coffee instead.
In order to support the development and maintenance of this guide you can also choose to sponsor this project. You can however also purchase the kindle or paperback version through your preferred Amazon website.
Kindle Unlimited subscribers can download this book for free through the marketplace where you get all your Kindle Unlimited books.
The official book title is "Rust Programming Language Learning Guide", by "Glen De Cauwsemaecker", and its ISBN-13 is "9798862715767".
You can find the book for sale at the following Amazon locations:
The kindle book will get updated several times per year. The paperbook gets updated less frequently then that.
This website gets updated the fasted. As such, feel free to continue to use this website as your prinary guide, and if possible, you can therefore also choose to sponsor me instead.
In case you're new to the language we suggest you to take a look at Learn Rust (free):
- The Rust Programming Language - The Rust Programming Language gives you a very nice overview;
- There are plenty of exercises in the book and at the end of your learning journey you'll get to build your own multi-threaded web server!
- GitHub - rust-lang/rustlings: Small exercises to get you used to reading and writing Rust code! is an alternative more pragmatic approach on learning the language;
- Introduction - Rust By Example is there for people who like learning from real-world examples;
- https://learn.microsoft.com/en-us/training/paths/rust-first-steps/ is yet another alternative, this time offered by Microsoft, which seems very similar to the rust book, but more pragmatic tones and you can earn XP!
Sooner or later you might also need help for a project you work on or simply to learn a concept you do not really understand. Not everybody has a senior or friend around that can help them out with this. For all of this and more you want to probably join one or multiple of the community chat servers listed in Appendix VII. Community Chat.
ⓘ Hardcore alternative
Programming Rust, 2nd Edition (O'Reilly Publishing) is a big book and will take you some time to get through. It is not for the faint of heart. However… If you do choose for this route as an alternative to (1) Learn Rust, you will absolutely not regret it. In fact, your entire rest of the Journey will be a breeze.
The "Programming Rust, 2nd Edition" book is a gem and in case you can handle big dry Technical books such as these it is one that will give you just as much love back as the energy that you put into it. Take your time, get through it, play with it, and enjoy. In fact, it can be easily paired with Rustlings by doing the exercises linked to the content you're reading. Rust by Example can also be added on top of that to see some more code related to the stuff you're learning.
Soak it in. It's a hardcore alternative, but if you're up for it, it's there for you to grab.
If you've never done any Systems programming before, this will be an especially helpful book given it will explain a lot of the magic you've encountered in your very protected professional life so far. You're welcome.
This project is meant to give an experienced programmer a swift introduction to Rust as an alternative to reading lengthy book style documentation.
- Chapter 1 - The Basics
- Chapter 2 - Basic Control Flow
- Chapter 3 - Basic Data Structure Types
- Chapter 4 - Generic Types
- Chapter 5 - Ownership & Borrowing Data
- Chapter 6 - Text
- Chapter 7 - Object Oriented Programming
- Chapter 8 - Smart Pointers
- Chapter 9 - Project Organization and Structure
- Chapter 1-4 should give you a strong taste of Rust's aesthetic
- Chapter 1-6 should give a person from C a good idea how their ideas translate
- Chapter 1-8 should give a person from C++ a good idea how their ideas translate
- Chapter 9+ should talk about Rust specific concepts that doesn't fit well into the above
This project also aims to provide this book in as many languages as possible.
There's only one Rust book out there — that I'm aware of — which assumes no programming experience or knowledge at all.
The "Learn Rust in a Month of Lunches" book by David MacLeod is available at https://www.manning.com/books/learn-rust-in-a-month-of-lunches.
It's a pretty unique and amazing book. Personally I do value of reading the same knowledge from many different PoV, both to understand the different angles on the same topic, but also as a way of learning by repetition. As such I think the original guide structure does still make sense.
That said I do appreciate that not everyone has the stamina for a long Rust Journey. As such, if you want only a single resource or book to help you get started with Rust, beginning from zero, I can highly recommend this book. The chapters are pretty unique and read very smooth. Once you finished this book you should be ready to immediately skip to the advanced parts of this guide, such as watching the Crust of Rust video series by "Jon Gjengset" or reading the Rust for Rustaceans book.
It's honestly an amazing book, you won't regret picking it up, be it your only beginner Rust book or just one of many angles.
That said, even if you skip the "learning material" from the first parts of this guide, because you're using this book, you might never the less want to look into and reference the earlier chapters for inspirational material, both for learning even more, as well as getting inspiration on the things you can build for fun, learning purposes or profit.
Welcome to Comprehensive Rust 🦀 - Comprehensive Rust 🦀: a small bootcamp course by Google focused on Android Engineers. Most of it is however applicable to anyone coming to Rust from another language and could be a great alternative or companion for some of the resources above.
Google has a blog article about "Comprehensive Rust" to look back at a year of Teaching rust within Google, available at https://security.googleblog.com/2023/09/scaling-rust-adoption-through-training.html.
The "Effective Rust" book is an excellent book that might just as well be official Rust material, and recommended for all Rust learners. So once you think you understand the content of "the Rust book" and the like, you probably want to start reading "Effective Rust", you won't regret it.
Questions you should be able to answer at the end of this step:
- Rust is a Memory-Safe language. How? Why? In what way is this different from other Memory Safe languages such as Go?
- Rust is a performant language. Why can it claim this. How?
- How do you structure data in Rust?
- Is data passed by Reference or value in Rust? And what does it mean?
- Is data mutable or immutable by default? How do we make it the other way?
- What are traits and how are these related to the data models that you structure in Rust?
- How can you extend the behavior of external types?
- Can you extend behavior of external types using external traits? Why or why not?
- What is a constant? Where can we define these?
- What is a static variable? How is it different from a constant? What's special about mutable variables?
- How does Rust support Async Rust? How do you use it? What are Futures?
- How do you achieve parallel programming in Rust?
- What's the difference between async programming and parallel programming? How are they related?
- What is the borrow checker? What is ownership? How are these concepts related?
- Data can be moved and it can also be dropped. What do we mean with this? How do we have control over this?
- How do we achieve shared mutable references to the same data? How can this be done safe?
- What are lifetimes? How do they work? Can you give some examples of where these are used?
- What are generics? Why do we use them?
- What are Rust Macros? When do we use these? What type of Macros are there?
- How do you build Rust projects?
- How do we use dependencies of other developers into our projects? And how do we call such dependencies?
- What are sum types? What are product types?
- What is an Enum in Rust and how can we use it? How can we define it?
- What is pattern matching in Rust? How do we do it? How is it more powerful than a switch?
- How do we write tests in Rust? What kind of tests are there?
- What are closures and how are they related to functions? What do they have in common? How do they differ?
- What kind of smart pointers does the Rust std library provide you? What are their use cases, differences, and so on?
- What is unsafe Rust? How do we use it? When do we use it? What guarantees do we still get, even when using unsafe Rust?
- Introduction - The Cargo Book: Cargo is the Rust package manager. Cargo downloads your Rust package's dependencies, compiles your packages, makes distributable packages, and uploads them to crates.io: Rust Package Registry, the Rust community's package registry;
- Getting started - Command Line Applications in Rust: Gives you another practical approach in your Rust Learning, by specifically learning how to write CLI applications in it;
Questions you should be able to answer at the end of this step:
- Make sure to be able to answer all questions of step (1).
- What is cargo and why does it exist?
- What kind of extensions exist for Cargo, how do we install them, how do we use them and what are some commonly used ones?
- What is the Cargo.toml file?
- What is the Cargo.lock file?
- What are build scripts? Why do we use these? How do we use these?
- How can we build code? How do we test code?
- How can we check code without building the final binaries?
- How do we make a simple CLI application? How do we pass arguments and flags? How do we handle signals?
- How can we structure our code and package(s)?
- What does public and private mean in the context of Rust? At what scope do these operate?
Once you went through the resources in the previous two chapters you might want to start working on a real project to start applying and solidifying your knowledge. A classic way to do this is by porting a small specialized codebase from one language to Rust, keeping in mind to not 1-to-1 map the lines of code but to instead focus on porting the logic with the "Rust way to do things" in mind.
Should you want some inspiration or a more guided approach, here are some resources that could help you out with this extra optional, but recommended step:
- Command-Line Rust: build a cli tool such as grep in rust, using test driven development (TDD), all to learn Rust
- Rust Application Books - The Little Book of Rust Books: lists a lot of different books, including ones that allow you to develop small projects using Rust, usually in a well guided fashion;
- You might find https://archive.is/acQA2 an interesting companion article as it gives some (common) ideas that you can apply to the CLI tool you're building;
- Introduction - PNGme: An Intermediate Rust Project is an especially fun small project. It allows you to apply the knowledge that you learned above in a very narrow program, that is for once not network related. At the end you'll have a cli tool that allows you to encode and decode "hidden" messages in a PNG image;
Was it always your dream to make your own Game? And do you also want to learn Rust?
https://bfnightly.bracketproductions.com/webbuild.html might be the free online guide for you!
In this tutorial you go through the entire process of building your own game and compile it to WASM so that you can play it directly from any modern browser!
If you like this tutorial and other material by Herbert Wolverson you can also go over to https://pragprog.com/titles/hwrust/hands-on-rust/ and buy his book, available as paperback and ebook.
Most pragmatic commercial Rust books cover Macros only as much as you need to know about them:
- What are macros?
- How do they work?
- How to read them?
- And some books might even teach you about
cargo expand(the tool that will help you with reading macros);
When the day comes that you do feel ready to learn about Macros, here a list of extensive resources all about macros:
- Introduction - MacroKata: Macro's are in general not very covered in the resources above, as it is not that common that you have to write your own macros. They can however be convenient in certain situations. This book can be seen as a bootstrap tutorial to get you started with one kind of Rust macros.
- If you are interested in (also) learning procedural macros you can perhaps consult the following resources:
- GitHub - dtolnay/proc-macro-workshop: Learn to write Rust procedural macros [Rust Latam conference, Montevideo Uruguay, March 2019]
- Procedural Macros in Rust (part 1)
- Check out "Diesel is a Safe, Extensible ORM and Query Builder for Rust" if you want to see a very cool example of macros (besides all the derives, formatting and printing you might already have been doing)
- json in serde_json - Rust is another neat example as it allows you to quickly define a Json value directly in Rust
- Taking a couple of hours is also a life well spent reading through this codebase as it will teach you a lot of nice things about Rust, especially given how simple and scoped the problem of json serialization is. It will really show you and teach you how serde works and why it works;
- Most web frameworks (if not all) in Rust also heavily make use of Macro's to give you a very neat and clean API
- And of course do not forget to consult the "classic" macro Rust book: The Little Book of Rust Macros
- If you want to get a quick intro and overview of Macros this video can help a lot as well: Rust's Witchcraft
- If you are interested in (also) learning procedural macros you can perhaps consult the following resources:
🔗 Rust Power Tools (MEAP) (By Manning Publications Co.)
A great book to help you with supercharging your code with macros—the real power tools of the Rust programming language!
This book focuses mostly on Procedural macros, but does give a quick intro of declarative macros as well (
Rust Power Tools is a comprehensive guide to creating macros in Rust. You’ll start your journey with declarative macros, then quickly move on to the powerful procedural macros to build your own domain-specific language. Learn how to create public fields, work with custom attributes, integrate your macros with other crates, write effective tests to ensure your macros are reliable and bug-free, and even share your macros with other developers.
If you have a lot of free time at your hand and you want to build something really cool that is totally useless, here are some more ideas:
- Build your own Gameboy (classic) emulator: Introduction - DMG-01: How to Emulate a Game Boy
- Build your own CHIP-8 (8-bit computer) interpreter: Cowgod's Chip-8 Technical Reference (no Rust guidance, directly from the CHIP-8 specification instead, you can do it, I believe in you)
- Build your own Ray Tracer (not a Rust tutorial, but can easily be implemented in Rust as well): Ray Tracing in One Weekend Series (fun if you always had the dream to start dabbling into the world of Graphics Programming)
- https://www.superperfundo.dev/?tag=ray-tracer-challenge might be a useful blog series if you want a more guided approach on how you might make a Ray Tracer in Rust;
- https://archive.is/t6Ifp is an interesting article in this area as well, where it introduces you to a language called PO;
Seriously though, do not consider the above recommended or mandatory in any way. If you however really like to develop stuff and you do like to do it extensively in your free time, then, and only then, I do believe that the above are a great way to really solidify your current Rust knowledge and give yourself a great (pragmatic) foundation.
At this point you might also be ready to start reading alternative — community driven — learning resources on foundational Rust knowledge. With such content you do however always need to be careful as they might contain mistakes, not well rounded or closed opinions. An example of possible valuable learning resources are the following blog series about the Rust type system:
- part 1 (https://sanjuvi.github.io/Blog/posts/Rust-type-system-part-1/): ownership and move semantics, aliasing and mutation, lifetime and region based resource management;
- part 2 (https://sanjuvi.github.io/Blog/posts/Rust-Type-System-Part-2/): type as sets, algebraic data types, patterns in Rust using Algebraic types, traits, generic associated types (GAT), operator overloading, use cases;
- part 3 (https://sanjuvi.github.io/Blog/posts/Rust-Type-System-Part-3/): container types, interior mutability, concurrency, deadlocks without threads.
More parts to come as well.
For the brave among you with the time for it, learn to build your own Operating System (OS) using Rust: https://os.phil-opp.com/
At this point of your Rust learning journey you've come a far way already, relatively speaking. Perhaps you want to shortcut, at least for now.
If so, the still to be published "Code like a pro in Rust" book might be enough for you to quickly get from beginner to advanced Rust programmer.
Once you get at this point you are around the level of a beginner or intermediate Rust programmer. At this point you could already start to tackle stuff like "Rust for Rustaceans" of step (6). However it might be a bit much.
Therefore while you go through the next couple of sections it could be helpful to now and then (e.g. while washing dishes or instead of Netflix) an education Rust code video. In the appendix at the bottom of this page there a couple of such suggestions.
Particular to this context you might want to save the "Crust of Rust" playlist. Each video will go over a specific topic, e.g. Lifetimes, macros, Atomics, … No need to watch them one by one, feel free to jump to them in whatever orders and only those that interest you (which is the same tip that I can give for the "Rust for Rustaceans" book).
Designing APIs is a big part of being a Rust programmer, any programmer really. Once you start to get comfortable enough in Rust or start building your own public crate, it is a topic you'll want to invest in.
A good starting point is the API Guidelines which are a set of guidelines that are meant to help you design good APIs. They are not meant to be followed blindly, but rather to be used as a reference to help you make the right decisions.
A next and continuous step is to read blog posts and watch videos about API design. The Rust newsletter often has an article listed in its weekly edition. But other platforms such as HackerNews will have interesting Rust articles pop up as well. https://sabrinajewson.org/blog/errors is for example a great article talking about one might to give errors as much love as the other parts of the API, and also talks about why crates like
thiserror might not be that great. All in all, similar to other parts of your continuous Rust learning journey, you'll want to remain critical and open to new ideas and see what works for you and what not.
If you are however still in the camp of
thiserror, you might be able to make good use of blog posts such as https://determinate.systems/posts/instrumenting-axum that guide you through adding instrumentation to your Axum based web service,
thiserror among other excellent crates such as
tracing. A great read, especially if you're not that experienced with instrumentation
that goes beyon the basic single line logs.
There is no standard / official Asynchronous runtime. This in contrast to actual CPU threads which you can create from within the std library.
The most popular and recommended by many Async Runtime is the Tokio runtime. Which brings us to the next chapter:
- To start with your Async Learning Journey you might want to start with: Getting Started - Asynchronous Programming in Rust;
- Afterwards you can finally start going through the Tokio learning journey Tutorial
Please also join the Tokio Discord community as part of your async Journey, a place where you can ask any questions you want as well: https://discord.com/invite/tokio. This server also has individual channels for the different projects in the Tokio ecosystem such as Hyper, Axum, Tower and more. The maintainers of the different projects are also very active in the server and are happy to help you out, but of course please do not take this for granted. Be respectful and if possible contribute back to the community as well.
The following article is a very nice introduction to Rust async: https://ibraheem.ca/posts/too-many-web-servers/.
Extra Learning Resources:
- https://bitbashing.io/async-rust.html: great article to make you think about why Async rust might feel so wrong.
- A big problem is that most people use Tokio in multithreade mode which puts extra restrictions (Send + 'Static), which makes Async feel extra difficult.
- It's also important that people, next to having experience with Tokio and getting a good understanding of Async rust and all it entails,
to also discover, play and use other async runtimes.
- https://github.com/smol-rs/smol is a great alternative Async runtime that you might want to try out;
- Learn more about Async Rust and what the current situation is/was in 2023: https://corrode.dev/blog/async/
- Get an understanding about issues you might encounter at Rust regarding Async:
At https://without.boats/blog/why-async-rust/ you can reat more thoughts on Async rust, its history and its implementation.
As an extra, and perhaps slightly sidetracked, you may also want to read and develop alongside the following articles:
- The HTTP crash course nobody asked for
- Understanding Rust futures by going way too deep
- To get to get a deeper understanding about the concepts of pinning and the like you might find the following articles helpful:
- Put a pin on That
- All of the above are great articles to get you quickly up to speeds with the concept, and helpful as a repeater or because you have no desire or time to read some of the books that talk about this topic and that I recommend in other parts of this guide;
In order to help you understand how Async code works (e.g. what about the Async keyword and How do futures really work. And how do you define traits with futures. And How do you implement them), you might want to read through the articles linked in the Tower section, as seeing how to implement your own Tower middleware might answer many of such questions. Gaining a deeper theoretical but still pragmatic enough understanding behind it is probably better done by reading some of the books listed in this guide.
ⓘ Note: Tokio also provides support to the new Linux kernel io_uring concept, a new powerful way to allow async programming on Linux. Support for it can be found at: GitHub - tokio-rs/tokio-uring: An io_uring backed runtime for Rust
Synacktiv made an IO network scanner using io_uring as can be seen at GitHub - synacktiv/io_uring_scanner: io_uring based network scanner written in Rust, using tokio's low level userspace bindings to io_uring.
To get a better idea about how futures work and the executor which polls them, you might want to read this article: https://bertptrs.nl/2023/04/27/how-does-async-rust-work.html.
The blog series as found at https://hegdenu.net/posts/understanding-async-await-1/ can be another great reference to help you understand the entire
async/await part of Rust:
- part 1: why doesn’t my task do anything if I don’t await it?
- part 2: how does a pending future get woken?
- part 3: why shouldn’t I hold a mutex guard across an await point?
- part 4: why would I ever want to write a future manually?
Sooner or later you'll also start to see the conterversy surrounding Async, while most do agree it's a a great thing to be and have,
and also acknowledge the hard work that is put into it, but not about all implementation details people agree.
One such detail is about whether we really need
async fn syntax, an interesting take about that can be read at
https://seanmonstar.com/post/66832922686/was-async-fn-a-mistake. Like always follow interesting blogs,
and news resources such as "This week in Rust".
There are currently not yet async iterators. An interesting blog series that can help you get a grasp of what async iterators might look like or to get you start thinking on it is the following series by "Yoshua Wuyts":
- Async Iteration I: Semantics (2020): https://blog.yoshuawuyts.com/async-iteration/
- Async Iteration II: Async Iterator Crate (2022): https://blog.yoshuawuyts.com/async-iterator-crate/
- Async Iteration III: The Async Iterator Trait (2023): https://blog.yoshuawuyts.com/async-iterator-trait/
Questions you should be able to answer at the end of this step:
- How does Async programming work in Rust, if you didn't understand this already?
- What types of concurrent programming does Rust support? How many are there in general?
- What are Futures and how do they work? What function they have? How do they affect you?
- What is Send and Sync? What is it used for? How does it affect you?
- What are good use cases of Async code? What kind of tasks aren't a good fit for this?
- What are Async Executors? What are Async Runtimes?
- What is Tokio? How do you use it? What does it give you?
- What are some other libraries in the Tokio ecosystem?
- What can you build with Tokio?
- Why would you use Tokio?
- How do you achieve Async Rust programming with only standard library (stdlib) code?
- Why does Rust not bundle an Async runtime?
- What is parallel programming? How do you do it in Rust? How does it relate to Async programming?
Understanding concurrency, the primitives used to do so safely and how it all works "under the hood" (e.g. the OS level) is not critical but it will help you big time the rest of your Async professional career.
The book "Rust Atomics and Locks" by O'Reilly is an amazingly good book by Mara Bos, an important Rust Contributor. Going through the book will take you some time despite its smaller size, but doing so is very rewarding. As with any technical book it is best to read this book as well as do its exercises and apply its knowledge using one program or another. Learn, Apply, Repeat. Play with it, Understand it.
This book is so good, that even Go, Python or JS developers that will never ever touch Rust, might want to learn Rust just to understand the knowledge that can be found in this Gem of a book. Read it. You won't regret it.
As it is more advanced knowledge it can however be seen as "Extra", so in case you are in a hurry to finish section (3) of the Rust track, feel free to skip it. But even if so, keep its existence in mind and come back to it perhaps when you start to get yourself into trouble.
FYI: if you ever write real-world production low level sync/atomic/concurrent code, you might want to check out Loom, as it will help you test that code better then possible with regular tests: https://docs.rs/loom/latest/loom/.
Questions you should be able to answer at the end of this extra step:
- What primitives are there in general to achieve concurrency?
- What primitives does the OS give you?
- What is the difference between threads and async programming?
- Why is async programming faster?
- When would you use threads? When would you use async programming?
- What's a Mutex? How could you implement one?
- What's a Conditional Variable? How could you implement one?
- What's a Signal? How could you implement one?
- What's a Channel? How do you implement it? What types of channels are there?
- What is Reordering? How can we deal with this? How does it affect us?
- How can we efficiently make a thread go to "Sleep" and have it woken up again?
- What's a Spin Lock? How do we build one?
- What's an atomic? What kind of atomics are there? How do they work under the hood?
- How does Rust achieve thread safety?
- What's Memory Ordering? What's the Memory Model? What types are there? Which ones can you use?
- What is Acquire and Release? What is this an example of?
- When we talk about a "happens-before relationship". What do we mean with it? Why is it important?
- What is caching in context of your CPU? How does it affect us? What can we do about it?
Please do remember that Async programming is only beneficial to optimize the idle time of your threads away. For tasks where you already near 100% utilize your threads (e.g. computation heavy algorithms) something like async will not help you and will in fact make your codebase a lot more complex and difficult to reason about.
Should you have computation-heavy algorithms which you want to parallelize you can achieve that by making use of threading alone. A crate such as https://docs.rs/rayon/latest/rayon/ might help you a lot with this as well.
Once you step into the world of Async Rust, Tokio and Web Services you'll sooner or later come across Tower, in a similar fashion as Serde blew your mind away for your serialization needs. Yes it did, you can admit it, this is a safe space.
ⓘ Tower is a library of modular and reusable components for building robust networking clients and servers.
With Tower everything is a service. A service takes in a request and outputs either an error or a response. What the actual types for these request-response pairs are, is up to you and depend mostly on the layer it is used.
In tower it is typical that a service wraps another service, called "layers", as such all your services and middleware will stack on top of each other, like a... tower.
- if you are new to Tower, you can start learning how to use it by building your own tower middleware from scratch by following the guide at: https://github.com/tower-rs/tower/blob/master/guides/building-a-middleware-from-scratch.md;
- if you are not convinced on the usefulness of Tower, you can perhaps read the "inventing your own Service trait" guide.
If you want to get an idea of how
Tower might look like in a Rust ecosystem since 2024,
you can enjoy this future today already at https://github.com/plabayo/tower-async.
Have fun not requiring to implement futures by hand.
The next sections are all optional and are not required to really be productive in Rust. Some of it are alternative resources or extra content to learn from. Others is just miscellaneous content that is not really required to be productive in Rust, but might be interesting to you.
This guide is either way not meant to be read in a single session or series. Take it as yours and just use it as part of your learning journey. Take your time as learning Rust isn't easy, but it is a very rewarding one once you did climb the mountain and are dancing with a double rainbow in the background.
Go through the entire book, filling any gaps you might still have and do all the exercises as well.
At the end of the book you should be able to present your own GitHub or GitLab hosted projected based on the exercises and projects of the books, where you applied all your knowledge and also put in something of yourself in it.
ⓘ Backend frameworks like Rocket and Actix are pretty commonly used in books. However know that the Axum framework is currently probably your best if you need to choose a backend framework for your next or current Rust project.
Learning Axum in specific could be done by following tutorials such as https://github.com/jeremychone-channel/rust-axum-course, which seem pretty complete and focussed.
Given how much Axum is built with Tower in mind, you probably also want to learn that.
There's also a "Crust of Rust" episode, by Jon Gjengset, about "decrusting" Axum — and by extension Tower — available at https://www.youtube.com/watch?v=Wnb_n5YktO8.
Questions you should be able to answer at the end of this step:
- How can we write a Full stack app in Rust?
- How can we deploy and host a Full stack Rust app in the cloud?
- How can we add telemetry?
- How can we interact with Databases using Rust?
- How can we debug production-quality Rust applications?
- How can we test Rust applications?
- How do we make Async applications in Rust?
- How do we achieve TLS capabilities with Rust?
- How do we make a web server with Rust?
- The book uses Actix. What are some alternatives these days?
The goal of hands-on learning with "Zero to Production" is mostly to help you get started writing some actual Rust projects, there are however also plenty of alternatives to achieve the same.
- https://knowledge.dev/ is an interactive book to help you practice Rust by doing projects;
- https://www.rustadventure.dev/ is a similar concept, which also has a discord and a bit more variety in projects;
- most Rust conferences also have workshops, free or paid, to help you get into Rust or tackle more advanced concepts;
- Shuttle, which allows you to build and ship Rust code, also has a series of tutorials to create, build and ship all kind of projects, available at https://www.shuttle.rs/launchpad;
- https://codecrafters.io/ is a paid platform (with very limited free tier) is a platform to help you build projects like your own Redis, Git, Grep, Docker and more. And that all using Rust (among other languages available);
Contribute to an open source project that you like or may want to strongly depend upon in the future.
Many projects have a
good first issue label, which is a good place to start. You can also look for issues that are labeled
help wanted or
There's also the Rust Mentorship program, which pairs up new contributors with experienced Rustaceans. You can find more information about it at: https://rustbeginners.github.io/awesome-rust-mentors/
In The weekly Rust Newsletter you can find a list of projects that are looking for contributors.
If you are a seasoned programmer already you might also opt to already start making your own new project or porting a scoped project from another language to Rust.
Go through the entire book, getting a deep(er) understanding of the advanced concepts and inner workings of them.
At the end of the book you should be able to present your own GitHub or GitLab hosted projected based on the exercises and projects of the books, where you applied all your knowledge and also put in something of yourself in it.
Questions you should be able to answer at the end of this step:
- Be able to answer all questions from previous sections, in full confidence and in a lot more depth than you could do before.
- How is memory laid out for your Rust Data structures? Can you control it? If so, how?
- Explain in full detail so someone new to Rust can understand it what borrowing and lifetimes are, how do they work, why are they important, how do they affect us, how do we encounter it, why do we use it?
- What primitive types are there in Rust and how are they laid out in memory?
- What is the Orphan rule? Why is it important?
- What is polling in the context of Asynchronous programming?
- List some additional testing tools beyond unit tests? Why does each one of them matter?
- What is Pin and Unpin?
- Note: Crust of Rust also has a great video about it should you need some more explanations about this tricky concept;
- Why is Asynchronous programming more complicated than parallel programming?
- How can you test your Asynchronous code? And because it is Rust, what kind of Asynchronous problems do we not need to test if we structure our code right? And why not?
- In the context of concurrent programming, what are actors?
- Bonus question: why do some people see this as the future?
- What is FFI? Why do we use it?
- What is Rust without the STD? How do we use it and why?
- What are some common patterns found in the wild and that are discussed in the book?
- How can you continue to learn Rust?
Start a project for yourself, your dog, your organization or mother. This might be a microservice, library or small tool. Everything is possible.
Another option is to contribute to an open source project that you like or may want to strongly depend upon in the future.
See section (5) about your first contribution for some inspiration on where to start.
As it is assumed that at this point you are doing intermediate level work in Rust it will be the case that sooner or later you'll need to debug. Or perhaps you are about to deploy your own small project to production. In any case, you'll need to know how to debug Rust applications. You can read all about this and tracing in Appendix VIII. Debugging Rust.
If you have completed all the steps above, you have done more then enough and can call yourself a Rustacean. You can now start to contribute to the Rust ecosystem and help others to learn Rust. Perhaps more importantly, you have all the knowledge you need to build your own projects in Rust.
What you'll build depends on your interest or perhaps in the type of industry or company you're working in.
- If you're doing full stack development you can get inspired on what's next by checking out WASM Learning Resources Appendix;
- For all your web dev needs you might also get inspired on what frameworks to use by checking out a website such as https://www.arewewebyet.org/;
- By coincidence, some of the books and articles listed in this guide also teach you a lot about web development, so if you did indeed complete these guide you're really already well on your way to becoming a full stack developer in Rust, or backend, whatever floats your boat;
- Some call WASM (on the server side) the next thing after docker containers. So perhaps even as a "pure" backend developer you might want to check out that same appendix to help you get started;
- If you're a game developer (or inspiring to be) you can check out resources such as https://arewegameyet.rs/#ecosystem to figure out what Rust technologies are out there in the ecosystem to help you build the next fantastic game;
- If you want to develop Operating Systems I already listed some resources to help you get started with that.
- Once (and if) Rust is accepted as a second language (next to C) to develop patches for the Linux kernel you can also start contributing to the Linux kernel in Rust. Future dreams;
- Or you might want to apply to Google and help build their Fuchsia OS in Rust. Have fun;
- It's open source so nobody can stop you to contribute it either way, well except them I guess;
- If you want to develop blockchain technology... Well, not going to guide you in that one, there's a running joke that it's hard to find a job in Rust that's not blockchain tech, so, you should have no problem finding a job in that field if that's what you want to do;
- Ok, ok. Here also a list for you folks: https://github.com/rust-in-blockchain/awesome-blockchain-rust
- If you want to develop embedded systems, you can check out the Rust Embedded Working Groups's Blog. There are also plenty of companies who sometimes appear in articles or podcasts listed in the More Material appendix, so you can also check that out for yourself.
- A podcast episode about the embedded WG can be found at: https://rustacean-station.org/episode/jonathan-pallant/
- You can interact with the WG using the matrix chat: https://matrix.to/#/!BHcierreUuwCMxVqOf:matrix.org
- If you are interested in using Rust for Data Engineering then https://datawithrust.com/ could be a great start;
A curated list of data & big-data in Rust can be found at https://arewedatayet.com/;
- Related to the previous, if you want to use ML from within Rust (or together with it), you might find the following list a great resource: https://www.arewelearningyet.com/
There's a lot more of course. You probably know best where you're going. A lot of exciting stuff is happening. Plenty of conferences (e.g. Rust Conf) to help you get inspired on it if you're not already. And of course, plenty of people to help you out if you get stuck. So, good luck and have fun!
In order to start using Rust you have to install and configure its tooling on your machinery.
- The Rust compiler (
rustc), standard library and tooling (e.g.
cargo) are all managed using
- You can learn how to get started by going to: https://www.rust-lang.org/learn/get-started
- Once you finished with this you'll have Rust ready on your machine out of the box. Each time there is a new version of Rust you can update it, simply by running
With this installed you should now be able to run the following command:
Which will output something like:
cargo 1.67.1 (8ecd4f20a 2023-01-10)
You can learn to create, compile and run your first Rust program at "First Steps with Cargo - The Cargo Book".
If you are looking for a fun bigger project to help you learn Rust, you might find it fun to buy your own cargo-like tool: https://blog.mgattozzi.dev/freight-part-1/
rustup component add clippy
- This way you can use the command
cargo clippyto help guarantee the quality of your code
- This way you can use the command
rustup component add rustfmt
- This way you can use
cargo fmtto format your code (best to also configure this in your IDE to be done each time you save the file)
- This way you can use
No custom linting configurations or agreements are required beyond this. If you use these two tools, you're golden. These tools also work nicely with any IDE you might use. Within your CI environment these same tools will be used to check that your code adheres to its standards.
Clippy can be seen as a testing ground to see what lints are useful and which ones aren't. The ones that are often get shipped into the official compiler a while later. Some lints are also ignored by default for whatever reasons. You can find all lints (AFAIK) at https://rust-lang.github.io/rust-clippy/stable/index.html, should you want to enable even more lints.
Some useful reasons why you might still want to enable custom lints are:
- to enable nightly features;
- to prevent the usage (in your own codebase) of
For reference you can check the https://github.com/plabayo/tower-async mono repository's
where I enable such opt-in lints myself, which itself is based on the original
ⓘ WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications.
WebAssembly on itself is completely isolated from Rust, but it must be said that among the WASM community, the Rust part is probably the biggest and most active one. Compiling Rust to WASM is a true pleasure and allows for browser client code to be written in Rust, be it a small library to be used from JS or an entire web client. WASM projects can also be used to quickly deploy web services (in the backend). These are similar to lambda functions but are even faster to use and in a way also safer.
- RustWasm book: Introduction - Rust and WebAssembly
- This is the officially recommended book to get you started, as can be seen at https://www.rust-lang.org/what/wasm
- Programming WASM with Rust: Programming WebAssembly with Rust
- Build a web app with Rust (using Yew framework): https://kerkour.com/web-application-with-rust-and-webassembly
- Rust to WebAssembly the hard way: Rust to WebAssembly the hard way — surma.dev
Frameworks that you might want to check if you want to make a front-end (web) app using Rust:
- Make desktop apps using web tech (think Electron, but better): GitHub - tauri-apps/tauri: Build smaller, faster, and more secure desktop applications with a web frontend;
- Very popular and fast front-end framework for Rust: GitHub - yewstack/yew: Rust / Wasm framework for building client web apps
- Another front-end framework: GitHub - chinedufn/percy: Build frontend browser apps with Rust + WebAssembly. Supports server side rendering.
- Yet another front-end framework: GitHub - sycamore-rs/sycamore: A library for creating reactive web apps in Rust and WebAssembly
- If you are looking for a complete framework you might want to give https://github.com/framesurge/perseus a chance, it builds on top of Sycamore;
- Exciting new and very fast front-end framework: GitHub - leptos-rs/leptos: Build fast web applications with Rust.
- Another front-end framework (or perhaps rather a GUI framework) that you might want to know about is Dioxus (https://dioxuslabs.com/) which is made not only for web-apps, but also with CLI, mobile and Desktop in mind.
- Also a pretty nice front-end framework: GitHub - framesurge/perseus: A state-driven web development framework for Rust with full support for server-side rendering and static generation.
Run WASM Backend Services in the cloud:
- Cloudflare workers: Cloudflare Workers®
- Fermyon Cloud (free for now): Deploy & manage cloud native WebAssembly apps
- Wasmer's goal is to run any code on any client (think Java's dream, but for real): https://wasmer.io/
As you can see, WASM on the backend is a thing. Whether it's more then just hype is something the future will tell, but either way a lot of interesting stuff is happening and there's big money behind it somehow. So you might as well jump in the car, especially if you missed the Docker train somehow. Happens.
Native apps are applications written for a specific platform. While that could be any platform, it usually refers to anything that is not the "web" and even more so, these days, it pretty much always refers to Desktop, Mobile or the combination of. Cross platform apps mean that multiple platforms are supported, which could be any set of web or non-web platforms.
If you ever need to interact with other native languages:
- For C you probably want to just use bindgen;
- For C++ you can make use of https://github.com/dtolnay/cxx (cxx);
- Alternatively there's also https://github.com/HKalbasi/zngur, how it compares to CXX is described at https://github.com/HKalbasi/zngur/blob/main/book/src/how_it_compares.md
- Binding to Java can be done using https://duchess-rs.github.io/duchess/
Tauri is the toolset you want to check out if you want to build native apps with a Gui in Rust. You can find all information about it on their official website: https://tauri.app/
ⓘ Build an optimized, secure, and frontend-independent application for multi-platform deployment.
Tauri applications can be compared to Electron, but it uses a very different approach. Multiple rendering engines are supported, with web view like rendering engines being the default. But this is still different then shipping a Node runtime and Chromium with each one of your apps. Meaning your desktop applications can be as small as a couple of megabytes, compared to the usually bloated 150MB apps. And once running, they will also be a lot less resource hungry compared to your topical Electron app.
Mobile applications are not yet officially supported, but they will soon get support as well, as the underlying technology for it is already more or less ready.
In case you want to write applications that work on both the web and a non-web platform you can achieve this by splitting your business logic from your minimal front-end logic, such that you can write one front-end in any of the available front-end approaches (e.g. leptos or perseus) and another one using Tauri, with most of your code being available as one or more Rust libraries.
The front-end logic can be written using any web application front-end framework, e.g. Svelte.
You can also opt to go fully native by using plugins such as tauri-egui: https://github.com/tauri-apps/tauri-egui
As with any (new) language, there's no point in replacing every existing technology written before, with a new implementation written in Rust. While at times there are benefits such as with ripgrep instead of grep, this is not a generally useful strategy not a desired one.
In case you have good reasons, such as security and being able to start with a clean slate for the most common use cases, it might however make sense to write critical software in a safe language if it was previously written in a so called unsafe language. This should be done with the greatest consideration and only if worth the costs it brings with it. Our Dutch colleagues working for "de Tweede Golf" are deeply invested in Rust and have now a version of
sudo written in Rust. You can read about it at https://tweedegolf.nl/en/blog/91/reimplementing-sudo-in-rust.
Of course, starting new projects inspired by classic/foundational tooling is however an opportunity to use Rust, even if your users do not need to know or care about it. A great example of that is just,a modern alternative to Makefiles, as much as love as we have for it. You can find it at https://github.com/casey/just, basically 'Make' with variables + more.
Graphite is an in-development raster and vector graphics package that's free and open source. It is powered by a node graph compositing engine that fuses layers with nodes, providing a fully nondestructive editing experience. It's fully written in Rust, and can be used as a desktop app or in the browser. The crazy thing is that as an artist using it you are basically "painting" Rust, as Graphite documents are really rust programs. As such most of their contributors are actually people with compiler/language backgrounds. Most users however will never know this, and neither do they have to.
- In Appendix II. we already saw that Rust can be compiled to WASM, and as such you can build an entire WebApp in Rust. However instead of replacing your entire WebApp, it is also just as well possible that you only replace the components of your App where it makes sense, e.g. where you need to do a lot of computations;
- In Appendix III. we learned about Tauri to build native apps with Rust, and also here noted that it can be done while at the same time building your core frontend logic in the frameworks you are used to;
At times however you might be able to incorporate the benefits of Rust in your existing benefits without having to expose the language to anyone:
- FNM is a replacement for NVM. While the latter is more powerful the first is a lot faster, which speeds up terminal start up times by a lot, just to give one benefit;
- SWC is a speedy light alternative to babel, with the first outperforming the last with its eyes closed and 1 foot still in the bed;
These give just a small taste of what Rust can mean for Web developers even if they do not know or use Rust themselves directly.
- Pydantic is a library for Data validation using Python type hints.
- Ruff is An extremely fast Python linter, written in Rust.
Python web developers can also make use of Rust to write their Python web services, without having to know Rust:
- Granian (https://github.com/emmett-framework/granian):
- A Rust HTTP server for Python applications (written on top of Hyper);
- Supports ASGI/3, RSGI and WSGI interface applications;
- Example usage: run your FastAPI web service :)
- Robyn (https://github.com/sparckles/robyn):
- A High-Performance, Community-Driven, and Innovator Friendly Web Framework with a Rust runtime.
- In contrast to
Granianthis does mean you need to write your service using the Robyn way to do things, so not possible to use an existing service built with FastAPI.
And plenty more will follow surely.
A language is a tool, but a tool is not to be applied to any problem. Rust has its advantages and use cases, it would be foolish not to use it where desirable.
Given how important Async is in our work environment it is still worth to go through section (3) "Learn Async Rust" to make sure you do really grasp that very well. It is also where a lot of your Rust knowledge starts to come together, so if you get that you know you're on the right track.
Should you after completing this book (even if partly) want to have some more hands on experience you can opt to never the less do section (4) as well and go through the "Zero to Production in Rust" book
However, in case you are confident you did get all the foundational concepts of Rust and want to just develop stuff already and get it "into your fingers" you might want to opt to after this (and before jumping onto section (5)) read "Rust In Action" first. It gives a lot of fun things to build. Alternatively you can check the "Learn More Rust: Extra" part of section (2) Learn more Rust, where we also go over many ideas for you to get more experience and help you solidify your Rust knowledge.
The "Rust in Action" book can also be seen as yet another alternative all together, as it is also aimed at introducing Rust to people who never did any Systems programming, So you could also do it instead of the Rust Web Programming book.
Do you ever want to develop something using both Rust and Python?
- Check out the pyo3 project: https://github.com/PyO3/pyo3
- You might also like the following resource in your learning journey of it: https://dora.carsmos.ai/blog/rust-python/
Learning to master a language has a beginning but it doesn't have an ending. You'll want to continue to learn, teach others and keep up to date. In this appendix you'll find material to help you with all this and more.
- The Rust Programming Language Blog
- e.g. in October of 2022 GAT's (Generic Associated Types) were finally stabilised, after 6+ years of work: Generic associated types to be stable in Rust 1.65 — Rust Blog
- The "Inside Rust" Blog
Conferences. There are many and even more meetups and other small gatherings. Here we'll only list the bigger (still active) conferences:
- RustConf, one of the larger annual gatherings of the Rust Community, in the US: https://rustconf.com/
- Rust Nation, a big conference held annually in London (UK): https://www.rustnationuk.com/
- EuroRust, another big conference in Brussels (Belgium, EU): https://eurorust.eu/
- RustFest, used to be a big global event, but no recent edition has taken place: https://rustfest.world/
- Rustacean Station is a pretty great podcast with very interesting guests and even more interesting knowledge to share. Listen to it, you won't regret: https://rustacean-station.org/
- In order to learn Rust you can also listen to the New Rustacean podcast, which is a podcast about learning Rust: https://newrustacean.com/
- It no longer airs, but its content remains useful and available
- "This week in Rust" is a weekly newsletter helping you stay up to date with Rust from the lazy comfort of your Mailbox. Easy. They can also be read online in case you prefer a browser instead or do not want to subscribe for w/e reason.
- Blog articles from the community get shared here as well, some accessible to new comers to Rust, others a bit more advanced
- They also share VOD's of recent conferences, e.g. the issue in which they share the rust talks from FOSDEM 2023: This Week in Rust 481 · This Week in Rust
- "Rust Magazine": an online magazine dedicated to Rust
community curated crate lists:
Free Rust Resources that we haven't mentioned yet, but are great to read at one point or another:
- The Rust Performance Book: https://nnethercote.github.io/perf-book/
- Rust Fuzz Book (Fuzz Testing): https://rust-fuzz.github.io/book/
- Idiomatic solutions to common programming tasks: https://rust-lang-nursery.github.io/rust-cookbook/
- The little book of Rust books: Unofficial Rust Books - The Little Book of Rust Books (which we also already linked in an earlier section)
If you learn by doing and haven't gotten enough from the resources we linked already in "Learn more Rust", here are some more tips:
- Implement a Redis client and server using Tokio, a very well documented and excellent guide on how to write Asynchronous code in Rust: https://github.com/tokio-rs/mini-redis/ - for learning purposes only
- If you want to improve your borrowing and reference skills, implementing a Linked List data structure might be for you: https://rust-unofficial.github.io/too-many-lists/
- Or perhaps you want to write your own OS in Rust: https://os.phil-opp.com/
A blog you might want to RSS subscribe to is Amos's his blog which is always fun to read, be it sometimes a bit heavy: https://fasterthanli.me/tags/rust/
A nice reference sheet if you need one can be found at: https://cheats.rs/
- Crust of Rust video series by "Jon Gjengset", for those that want to see an experienced Rust Developer work through problems: Crust of Rust
- You can combine it while learning a bit about networking and implement TCP in Rust yourself: https://www.youtube.com/playlist?list=PLqbS7AVVErFivDY3iKAQk3_VAm8SXwt1X
- If you like to learn by watching you can find a Rust streaming list at https://github.com/jamesmunns/awesome-rust-streaming/
- Interesting youtube channel with a lot of great stuff to learn about Rust: https://www.youtube.com/@NoBoilerplate
- If any of the basic (textual) learning resources from the actual learning journey didn't quite work for you, you might find a video course more useful. If so, here are two of them:
- If you need inspiration on things you can build with Rust to get the language in your fingers as well as learn how software that you use is implemented, you might want to check out: https://app.codecrafters.io/tracks/rust
- Learn Full Stack Rust Interactively: Rust Insight! - an interactive book for practicing Rust on the laptop (early access)
- A big index of many more learning resources, named aptly "How to learn Modern Rust — A Guide to the adventurer": https://github.com/joaocarvalhoopen/How_to_learn_modern_Rust
- Do not take the list as-is and use mostly as inspiration. No need to really do all on that list, but if you need more learning resources, there is plenty of good content and inspiration in there!
- Black Hat Rust book: https://kerkour.com/black-hat-rust (could be nice for inspiration on some hands-on experience while becoming more familiar with Rust)
- If you want to test your Rust concept skills you might also enjoy taking the Rust Quiz. The more answers you have wrong the better, as it means you'll learn new things from the explanation :)
- If you want to learn by doing by contributing to an existing Rust OSS project (including the Rust language and tooling) you can try to find a mentor to help you for free online in achieving this, by going to Awesome Rust Mentors: https://rustbeginners.github.io/awesome-rust-mentors/
Learning from and working with a community is one of the many perks of Rust, which is rightfully known for its warm, inclusive and charming community. Always open and friendly to others.
Here are some chat servers you can join to interact with this fantastic community. All of them are great places to meet other Rust developers, find help, share news or a project and also to give back to the community yourself:
- Discord chat server for the Tokio ecosystem and its community: https://discord.com/invite/tokio;
- Discord chat server for the Rust community in general (has a great channel for beginners to find help, and in a very fast manner): https://discord.com/invite/rust-lang;
- zulip chat server for Rust, great for core work and advanced purposes: https://rust-lang.zulipchat.com/.
There are others of course but these are the ones which are both active, inclusive, friendly and known to the authors of this guide as being a great place to be and be part of.
Debugging Rust code can be seen on three different levels:
- Write Rustic code, making full use of the language and its expressive type system;
- Have good logging and metrics in place for your production infrastructure;
- Know your way around a debugger.
Underappreciated is point (1). Ensuring that impossible state and behavior is in fact impossible at compile team and thus guaranteed by the compiler is a big class of errors that you simply can no longer make and thus never have to debug. Using maker types and enums can help you a lot here.
Rust is also a typed language so ensuring to use the proper types and use them consistently, will also help avoid a big category of bugs. Similarly, you probably do not really ever want to unwrap/expect any of your library code and only do so at the very top level, as to avoid nasty edge cases at runtime.
That being said, sometimes things do go wrong. And debugging in production is not always fun. In fact, trying to reproduce rare scenarios locally is even less fun. For that you really want to ensure you know the right tools and crates to help you deal with point (2).
- If you use Tokio then the
tracingcrate and its mini ecosystem will be your friend, to help you define logs, metrics and more.
- The more data you have for your production infrastructure the easier it should be to spot potential issues that you didn't foresee but that you do clearly see in your logs and/or metrics;
- If you really want to dive deep and also learn about its macros, a blog article like https://dietcode.io/p/tracing-macros/ might help you get into that;
- A blog article like https://broch.tech/posts/rust-tracing-opentelemetry/ might help you get started with Tracing in Rust, and introduce you to "Open Telemetry" in general.
- If you do not use Tokio, then a crate like log is your best bet, and it will ensure that no matter what application makes use of your crate, will be able to consume your logs the way they want :)
A detailed overview of logging libraries that are available can be found in https://www.shuttle.rs/blog/2023/09/20/logging-in-rust.
Benchmarking can also be seen as part of debugging. Difference is that you are trying to solve performance issues rather than business logic ones. Divan is a framework that can help with this and which was originally announced at https://nikolaivazquez.com/blog/divan/.
Finally when shit really hits the fan, and you do not see what's wrong from metrics and logs (alone), you might need to grab a debugger. The book https://rustc-dev-guide.rust-lang.org/debugging-support-in-rustc.html might be able to give you a good starting point. Articles such as https://dev.to/rogertorres/debugging-rust-with-vs-code-11dj might help you get started on debugging in case you are using VSCode for Rust, which is what plenty of people seem to use these days. There's also a Gist about it for VSCode at https://gist.github.com/xanathar/c7c83e6d53b72dd4464f695607012629.
Shipping Rust does not have to be different from shipping code in other languages. So all the knowledge you have or will learn about the Cloud, Docker, Bare Metal, Vms, Lambda functions, WASM workers, containers, and whatever else also can be applied here.
If you however find cloud platforms like AWS or GCloud a bit dounting (or have choice stress), and find deploying to your own VPS or VM a bit too barebones, you might find some of the following solutions to be helpful, specifically with the goal of shipping rust code such as a web service:
- https://fly.io/: allows you to ship rust code fairly painlessly by using docker containers;
- https://render.com/ ship rust code without having to define a docker container and with tls, cdn, db and other capabilities that can be enabled from an easy to use WebUI;
- https://www.shuttle.rs/ has a pretty unique approach by letting you deploy your Rust code directly, without containers,
and by adding your stack dependencies (e.g. database needs) as macros to your Rust
- Using https://github.com/cloudflare/workers-rs you can ship your Rust code to Cloudflare's workers platform;
- https://www.fermyon.com/# is another similar cloud platform that also allows you to ship Rust (WASM) workers;
If you want to ship on a more standard cloud platform such as AWS you can learn to do so as part of practicing Rust using "4. Study using the "Zero to Production in Rust" book".
Finally, in the spirit of KISS, nothing wrong with deploying like this: https://logankeenan.com/posts/deploy-your-rust-project-to-any-hosting-provider-in-minutes/.
- If you are woried about Supply Chain attacks you can have a look at https://davidlattimore.github.io/making-supply-chain-attacks-harder.html;