https://rust-exercises.com/ [ ] 1. 1. Welcome 2. 1. 1.1. Syntax 3. 2. A Basic Calculator 4. 1. 2.1. Integers 2. 2.2. Variables 3. 2.3. Branching: if/else 4. 2.4. Panics 5. 2.5. Factorial 6. 2.6. Loops: while 7. 2.7. Loops: for 8. 2.8. Overflow and underflow 9. 2.9. Saturating arithmetic 10. 2.10. Conversions: as casting 5. 3. Ticket v1 6. 1. 3.1. Structs 2. 3.2. Validation 3. 3.3. Modules 4. 3.4. Visibility 5. 3.5. Encapsulation 6. 3.6. Ownership 7. 3.7. Setters 8. 3.8. Stack 9. 3.9. Heap 10. 3.10. References in memory 11. 3.11. Destructors 12. 3.12. Outro 7. 4. Traits 8. 1. 4.1. Trait 2. 4.2. Orphan rule 3. 4.3. Operator overloading 4. 4.4. Derive macros 5. 4.5. String slices 6. 4.6. Deref trait 7. 4.7. Sized trait 8. 4.8. From trait 9. 4.9. Associated vs generic types 10. 4.10. Clone trait 11. 4.11. Copy trait 12. 4.12. Drop trait 13. 4.13. Outro 9. 5. Ticket v2 10. 1. 5.1. Enums 2. 5.2. Branching: match 3. 5.3. Variants with data 4. 5.4. Branching: if let and let/else 5. 5.5. Nullability 6. 5.6. Fallibility 7. 5.7. Unwrap 8. 5.8. Error enums 9. 5.9. Error trait 10. 5.10. Packages 11. 5.11. Dependencies 12. 5.12. thiserror 13. 5.13. TryFrom trait 14. 5.14. Error::source 15. 5.15. Outro 11. 6. Ticket Management 12. 1. 6.1. Arrays 2. 6.2. Vectors 3. 6.3. Resizing 4. 6.4. Iterators 5. 6.5. Iter 6. 6.6. Lifetimes 7. 6.7. Combinators 8. 6.8. impl Trait 9. 6.9. impl Trait, pt.2 10. 6.10. Slices 11. 6.11. Mutable slices 12. 6.12. Two states 13. 6.13. Index trait 14. 6.14. IndexMut trait 15. 6.15. HashMap 16. 6.16. BTreeMap 13. 7. Threads 14. 1. 7.1. Threads 2. 7.2. 'static lifetime 3. 7.3. Leaking memory 4. 7.4. Scoped threads 5. 7.5. Channels 6. 7.6. Interior mutability 7. 7.7. Ack pattern 8. 7.8. Client 9. 7.9. Bounded channels 10. 7.10. Patching 11. 7.11. Mutex, Send and Arc 12. 7.12. RwLock 13. 7.13. Without channels 14. 7.14. Sync trait 15. 8. Futures 16. 1. 8.1. Asynchronous functions 2. 8.2. Spawning tasks 3. 8.3. Runtime 4. 8.4. Future trait 5. 8.5. Blocking the runtime 6. 8.6. Async-aware primitives 7. 8.7. Cancellation 8. 8.8. Outro 17. 9. Going further * Light * Rust * Coal * Navy * Ayu 100 Exercises To Learn Rust [ ] Welcome Welcome to "100 Exercises To Learn Rust"! This course will teach you Rust's core concepts, one exercise at a time. You'll learn about Rust's syntax, its type system, its standard library, and its ecosystem. We don't assume any prior knowledge of Rust, but we assume you know at least another programming language. We also don't assume any prior knowledge of systems programming or memory management. Those topics will be covered in the course. In other words, we'll be starting from scratch! You'll build up your Rust knowledge in small, manageable steps. By the end of the course, you will have solved ~100 exercises, enough to feel comfortable working on small to medium-sized Rust projects. Methodology This course is based on the "learn by doing" principle. It has been designed to be interactive and hands-on. Mainmatter developed this course to be delivered in a classroom setting, over 4 days: each attendee advances through the lessons at their own pace, with an experienced instructor providing guidance, answering questions and diving deeper into the topics as needed. If you're interested in attending one of our training sessions, or if you'd like to bring this course to your company, please get in touch. You can also follow the course on your own, but we recommend you find a friend or a mentor to help you along the way should you get stuck. You can also find solutions to all exercises in the solutions branch of the GitHub repository. Structure On the left side of the screen, you can see that the course is divided into sections. Each section introduces a new concept or feature of the Rust language. To verify your understanding, each section is paired with an exercise that you need to solve. You can find the exercises in the companion GitHub repository. Before starting the course, make sure to clone the repository to your local machine: # If you have an SSH key set up with GitHub git clone git@github.com:mainmatter/100-exercises-to-learn-rust.git # Otherwise, use the HTTPS URL: # # git clone https://github.com/mainmatter/100-exercises-to-learn-rust.git We also recommend you work on a branch, so you can easily track your progress and pull in updates from the main repository, if needed: cd 100-exercises-to-learn-rust git checkout -b my-solutions All exercises are located in the exercises folder. Each exercise is structured as a Rust package. The package contains the exercise itself, instructions on what to do (in src/lib.rs), and a test suite to automatically verify your solution. wr, the workshop runner To verify your solutions, we've provided a tool that will guide you through the course. It is the wr CLI (short for "workshop runner"). Install it with: cargo install --locked workshop-runner In a new terminal, navigate back to the top-level folder of the repository. Run the wr command to start the course: wr wr will verify the solution to the current exercise. Don't move on to the next section until you've solved the exercise for the current one. We recommend committing your solutions to Git as you progress through the course, so you can easily track your progress and "restart" from a known point if needed. Enjoy the course! References * The exercise for this section is located in exercises/01_intro/ 00_welcome Author This course was written by Luca Palmieri, Principal Engineering Consultant at Mainmatter. Luca has been working with Rust since 2018, initially at TrueLayer and then at AWS. Luca is the author of "Zero to Production in Rust", the go-to resource for learning how to build backend applications in Rust. He is also the author and maintainer of a variety of open-source Rust projects, including cargo-chef, Pavex and wiremock.