Rust Playground

Write a Rust program and run it in your browser. Code is compiled by the official Rust Playground on the stable channel, edition 2024, as a binary crate with a main function. Tests are not run.

All lessons

  1. Hello, Rust!
  2. Variables & Mutability
  3. Data Types
  4. Functions
  5. Control Flow
  6. Ownership
  7. References & Borrowing
  8. Structs
  9. Enums
  10. Pattern Matching
  11. Error Handling
  12. Collections
  13. Traits
  14. Generics
  15. Lifetimes
  16. Closures & Iterators
  17. String Types
  18. Modules & Visibility
  19. Smart Pointers
  20. Concurrency