Rust By Example
Rust by Example aims to provide an introduction and overview of the Rust programming language through annotated example programs. It is a great place to learn Rust, and use as a companion for you to reference. In addition to Rust by Example also check out the excellent learning resources available here,
To start exploring, you can check out the first example or select a subject from the list below.
This project is heavily inspired by the amazing work of Mark McGranaghan. and Eli Bendersky on Go by Example.
- Hello, world!
- Variables
- Constants
- Enums
- Scalar Types
- Compound Types - Tuples
- Compound Types - Arrays
- Collections - Vectors
- Collections - Hash Maps
- Collections - Sets
- If/Else
- Match
- Loops
- Functions
- Closures
- Strings
- Structs
- Traits
- Generics
- Error Handling
- Ownership
- Pointers
- *Coming* Lifetimes
- *Coming* Concurrency
- *Coming* Async
- *Coming* I/O
- *Coming* Macros
- *Coming* Testing
- *Coming* Modules