1. Welcome to Comprehensive Rust 🦀
  2. 1. Using Cargo
    ❱
    1. 1.1. Rust Ecosystem
    2. 1.2. Code Samples
    3. 1.3. Running Cargo Locally
  3. Day 1: Morning
  4. 2. Welcome
  5. 3. Introduction
    ❱
    1. 3.1. What is Rust?
    2. 3.2. Benefits of Rust
    3. 3.3. Playground
  6. 4. Types and Values
    ❱
    1. 4.1. Hello, World
    2. 4.2. Variables
    3. 4.3. Values
    4. 4.4. Arithmetic
    5. 4.5. Strings
    6. 4.6. Type Inference
  7. 5. Control Flow Basics
    ❱
    1. 5.1. if Expressions
    2. 5.2. Loops
      ❱
      1. 5.2.1. for
      2. 5.2.2. loop
    3. 5.3. break and continue
      ❱
      1. 5.3.1. Labels
    4. 5.4. Blocks and Scopes
      ❱
      1. 5.4.1. Scopes and Shadowing
    5. 5.5. Functions
    6. 5.6. Macros
  8. 6. Exercises
  9. Day 1: Afternoon
  10. 7. Welcome
  11. 8. Tuples and Arrays
    ❱
    1. 8.1. Arrays
    2. 8.2. Tuples
    3. 8.3. Array Iteration
    4. 8.4. Patterns and Destructuring
  12. 9. References
    ❱
    1. 9.1. Shared References
    2. 9.2. Exclusive References
    3. 9.3. Static and Const
  13. 10. User-Defined Types
    ❱
    1. 10.1. Named Structs
    2. 10.2. Tuple Structs
    3. 10.3. Enums
    4. 10.4. Type Aliases
  14. 11. Exercises
  15. Day 2: Morning
  16. 12. Welcome
  17. 13. Pattern Matching
    ❱
    1. 13.1. Matching Values
    2. 13.2. Destructuring
    3. 13.3. Let Control Flow
  18. 14. Methods and Traits
    ❱
    1. 14.1. Methods
    2. 14.2. Traits
      ❱
      1. 14.2.1. Implmementing Traits
      2. 14.2.2. Associated Types
    3. 14.3. Deriving
  19. 15. Generics
    ❱
    1. 15.1. Generic Functions
    2. 15.2. Generic Data Types
    3. 15.3. Trait Bounds
    4. 15.4. impl Trait
  20. 16. Exercises
  21. Day 2: Afternoon
  22. 17. Welcome
  23. 18. Memory Management
    ❱
    1. 18.1. Review of Program Memory
    2. 18.2. Approaches to Memory Management
    3. 18.3. Ownership
    4. 18.4. Move Semantics
    5. 18.5. Clone
    6. 18.6. Copy Types
    7. 18.7. Drop
  24. 19. Exercises
  25. Day 3: Morning
  26. 20. Welcome
  27. 21. Smart Pointers
    ❱
    1. 21.1. Box<T>
    2. 21.2. Rc
    3. 21.3. Trait Objects
  28. 22. Borrowing
    ❱
    1. 22.1. Borrowing a Value
    2. 22.2. Borrow Checking
  29. 23. Slices and Lifetimes
    ❱
    1. 23.1. Slices: &[T]
    2. 23.2. String References
    3. 23.3. Lifetime Annotations
    4. 23.4. Lifetime Elision
    5. 23.5. Struct Lifetimes
  30. 24. Exercises
  31. Day 3: Afternoon
  32. 25. Welcome
  33. 26. Standard Library Types
    ❱
    1. 26.1. Standard Library
    2. 26.2. Documentation
    3. 26.3. Option
    4. 26.4. Result
    5. 26.5. Vec
    6. 26.6. String
    7. 26.7. HashMap
  34. 27. Standard Library Traits
    ❱
    1. 27.1. Comparisons
    2. 27.2. Operators
    3. 27.3. From and Into
    4. 27.4. Casting
    5. 27.5. Read and Write
    6. 27.6. Default, struct update syntax
    7. 27.7. Closures
  35. 28. Exercises
  36. Day 4: Morning
  37. 29. Welcome
  38. 30. Iterators
    ❱
    1. 30.1. Iterator
    2. 30.2. IntoIterator
    3. 30.3. FromIterator
  39. 31. Modules
    ❱
    1. 31.1. Modules
    2. 31.2. Filesystem Hierarchy
    3. 31.3. Visibility
    4. 31.4. use, super, self
  40. 32. Exercises
  41. Day 4: Afternoon
  42. 33. Welcome
  43. 34. Testing
    ❱
    1. 34.1. Test Modules
    2. 34.2. Other Types of Tests
    3. 34.3. Compiler Lints and Clippy
  44. 35. Error Handling
    ❱
    1. 35.1. Panics
    2. 35.2. Try Operator
    3. 35.3. Try Conversions
    4. 35.4. Error Trait
    5. 35.5. thiserror and anyhow
  45. 36. Exercises
  46. Day 5: Morning
  47. 37. Welcome
  48. 38. Threads
    ❱
    1. 38.1. Scoped Threads
  49. 39. Channels
    ❱
    1. 39.1. Unbounded Channels
    2. 39.2. Bounded Channels
  50. 40. Send and Sync
    ❱
    1. 40.1. Send
    2. 40.2. Sync
    3. 40.3. Examples
  51. 41. Shared State
    ❱
    1. 41.1. Arc
    2. 41.2. Mutex
    3. 41.3. Example
  52. 42. Exercises
  53. Day 5: Afternoon
  54. 43. Async Basics
    ❱
    1. 43.1. async/await
    2. 43.2. Futures
    3. 43.3. Runtimes
      ❱
      1. 43.3.1. Tokio
    4. 43.4. Tasks
    5. 43.5. Async Channels
  55. 44. Control Flow
    ❱
    1. 44.1. Join
    2. 44.2. Select
  56. 45. Pitfalls
    ❱
    1. 45.1. Blocking the Executor
  57. Final Words
  58. 46. Thanks!
  59. 47. Glossary
  60. 48. Other Resources
  61. 49. Credits

Comprehensive Rust 🦀

Pitfalls of async/await

  • Blocking the Executor