01 · Fundamentals and Typification
Default immutability, explicit mutability, shadowing, scalar and compound types with static checking.
- let / mut / shadowing
- const
- i32 / f64 / bool / char
- tuple / array / &str
End of the Rust Course
Congratulations! You have completed all 10 modules and 24 lessons of the Rust course — from immutable bindings and pattern matching to ownership, NLL borrowing, traits, lifetimes, zero-cost iterators, Cargo testing, and Arc<Mutex<T>> concurrency.
10 modules · 24 lessons · 120 checkpoints
Rust exercises are verified locally in the browser using Tree-sitter AST parsing (`tree-sitter-rust.wasm`) plus structural and keyword checks; for live compilation with rustc, click Open on Rust Playground (play.rust-lang.org).
Default immutability, explicit mutability, shadowing, scalar and compound types with static checking.
Conditional expressions, safe loops, handling of `Option<T>` and exhaustive matching guaranteed by the compiler.
The heart of Rust security: Stack vs Heap, Move semantics, Shared/Exclusive Borrowing, NLL and slice.
Data modeling with classical struct, tuple struct, automatic drifts, and encapsulation using `impl` blocks.
Zero-cost abstractions with parameters of type `<T>`, monomorphization, interfaces `trait` and constraints `where`.
Prevent dangling references with explicit lifetimes `'a` and handle advanced ownership with `Box<T>`, `Rc<T>` and `RefCell<T>`.
Standard data structures in Heap (`Vec`, `String`, `HashMap`) and robust handling of recoverable errors with `Result` and `?`.
Functional programming in Rust compiled into optimal machine loops using `Fn*` closures and lazy pipelines.
Organize crates and modules with granular visibility, manage Cargo dependencies, and write robust test suites.
Fundamental traits of the standard library, dynamic dispatch with `dyn Trait`, safe threads, `mpsc` and `Arc<Mutex<T>>` channels.
Combine idiomatic Rust patterns across five progressive stages: expression-based predicate is_even, in-place mutation via &mut i32, Counter struct + impl, iterator pipeline with ?, and thread-safe shared state using Arc<Mutex<usize>>.
Implement `is_even(n: i32) -> bool` returning an expression cleanly without a trailing semicolon (Module 1 + Module 2).
Define fn is_even(n: i32) -> bool returning n % 2 == 0 as the final expression of the function.
Write n % 2 == 0 directly without return or a trailing ;.
Solution available after 3 attempts
Apply borrowing rules by dereferencing an exclusive mutable borrow `&mut i32` (Module 3).
Define fn square_by_ref(n: &mut i32) that squares the referenced integer via explicit dereferencing (*n).
Inside square_by_ref, write *n = *n * *n; (or *n *= *n;).
Solution available after 3 attempts
Combine `struct Counter`, `&mut self`, and `&self` inside an idiomatic `impl` block (Module 4).
Implement struct Counter { count: u32 } with public associated constructor pub fn new() -> Counter plus pub fn increment(&mut self) and pub fn get_count(&self) -> u32.
new() returns Counter { count: 0 }, increment(&mut self) executes self.count += 1;, and get_count(&self) returns self.count.
Solution available after 3 attempts
Parse string slices propagating ParseIntError with `?` and filter even values with `.iter().filter().sum()` (Module 7 + Module 8).
Implement fn sum_even_parsed(items: &[&str]) -> Result<i32, std::num::ParseIntError> parsing entries with s.parse::<i32>()? and summing only even values.
Either loop with s.parse::<i32>()? or collect items.iter().map(|s| s.parse::<i32>()).collect::<Result<Vec<i32>, _>>()?, then filter n % 2 == 0 and sum.
Solution available after 3 attempts
Share mutable state across threads cleanly via atomic reference counting `Arc::clone` and RAII locking `Mutex` (Module 10).
Complete fn count_concurrent(steps: usize) -> usize allocating Arc::new(Mutex::new(0usize)), cloning into a move closure inside std::thread::spawn, locking with .lock().unwrap(), and calling handle.join().unwrap().
Create let counter = Arc::new(Mutex::new(0usize)); let cloned = Arc::clone(&counter);, spawn let handle = thread::spawn(move || { let mut guard = cloned.lock().unwrap(); *guard += steps; });, join, and return *counter.lock().unwrap().
Solution available after 3 attempts
Complete quick reference covering bindings, ownership, traits, iterators, Cargo tests, and fearless Send/Sync concurrency.
Keep sharpening your Rust skills locally with `cargo new` and `cargo test`, or test ownership and concurrency patterns directly in the interactive Playground.