[{"data":1,"prerenderedAt":812},["ShallowReactive",2],{"page-\u002Frust":3},{"id":4,"title":5,"body":6,"description":16,"extension":805,"meta":806,"navigation":807,"path":808,"seo":809,"stem":810,"__hash__":811},"content\u002Frust\u002Findex.md","Rust: Zero to Hero",{"type":7,"value":8,"toc":790},"minimark",[9,13,17,22,53,57,60,64,69,195,199,269,273,426,430,563,567,659,663],[10,11,5],"h1",{"id":12},"rust-zero-to-hero",[14,15,16],"p",{},"A complete quiz-based curriculum covering Rust from first principles to expert-level, production-grade knowledge. Ownership and the borrow checker are the spine of the language — the curriculum is sequenced so every later quiz assumes you can reason about them.",[18,19,21],"h2",{"id":20},"how-to-use-this-quiz-track","How to Use This Quiz Track",[23,24,25,29,32,45],"ul",{},[26,27,28],"li",{},"Work through the parts in order; Parts 3 onward lean heavily on the ownership model from Part 2.",[26,30,31],{},"Each quiz has 20 multiple-choice questions, ordered from basic recall to edge cases to best-practice judgment calls.",[26,33,34,35,39,40,44],{},"Click ",[36,37,38],"strong",{},"Show Answer"," only after committing to a choice — many questions hinge on ",[41,42,43],"em",{},"why"," the compiler accepts or rejects code, which only the explanation covers.",[26,46,47,48,52],{},"Expect borrow-checker \"gotchas,\" lifetime elision surprises, and ",[49,50,51],"code",{},"unsafe"," footguns — these are where real Rust competency is built.",[18,54,56],{"id":55},"prerequisites","Prerequisites",[14,58,59],{},"None for Part 1, though familiarity with a statically-typed language (C++, Java, Swift) makes the ownership model click faster.",[18,61,63],{"id":62},"curriculum","Curriculum",[65,66,68],"h3",{"id":67},"part-1-foundations","Part 1 — Foundations",[70,71,72,88],"table",{},[73,74,75],"thead",{},[76,77,78,82,85],"tr",{},[79,80,81],"th",{},"#",[79,83,84],{},"Topic",[79,86,87],{},"Why It Matters",[89,90,91,110,124,138,152,170],"tbody",{},[76,92,93,97,104],{},[94,95,96],"td",{},"01",[94,98,99],{},[100,101,103],"a",{"href":102},"\u002Frust\u002F01-introduction-and-setup","Introduction & Setup",[94,105,106,109],{},[49,107,108],{},"rustup",", toolchains, and editions set the stage for every later quiz.",[76,111,112,115,121],{},[94,113,114],{},"02",[94,116,117],{},[100,118,120],{"href":119},"\u002Frust\u002F02-hello-world-and-cargo","Hello World & Cargo",[94,122,123],{},"Cargo is Rust's build tool, package manager, and test runner — non-negotiable daily tooling.",[76,125,126,129,135],{},[94,127,128],{},"03",[94,130,131],{},[100,132,134],{"href":133},"\u002Frust\u002F03-variables-and-mutability","Variables & Mutability",[94,136,137],{},"Immutability by default and shadowing are core Rust idioms that surprise newcomers.",[76,139,140,143,149],{},[94,141,142],{},"04",[94,144,145],{},[100,146,148],{"href":147},"\u002Frust\u002F04-data-types","Data Types",[94,150,151],{},"Integer overflow behavior differs sharply between debug and release builds.",[76,153,154,157,163],{},[94,155,156],{},"05",[94,158,159],{},[100,160,162],{"href":161},"\u002Frust\u002F05-functions","Functions",[94,164,165,166,169],{},"Expression-vs-statement semantics (no ",[49,167,168],{},";"," = return value) is a classic first-week trap.",[76,171,172,175,181],{},[94,173,174],{},"06",[94,176,177],{},[100,178,180],{"href":179},"\u002Frust\u002F06-control-flow","Control Flow",[94,182,183,186,187,190,191,194],{},[49,184,185],{},"if let",", ",[49,188,189],{},"loop"," with break-values, and exhaustive ",[49,192,193],{},"match"," are distinctly Rust-flavored.",[65,196,198],{"id":197},"part-2-the-ownership-model","Part 2 — The Ownership Model",[70,200,201,211],{},[73,202,203],{},[76,204,205,207,209],{},[79,206,81],{},[79,208,84],{},[79,210,87],{},[89,212,213,227,241,255],{},[76,214,215,218,224],{},[94,216,217],{},"07",[94,219,220],{},[100,221,223],{"href":222},"\u002Frust\u002F07-ownership","Ownership",[94,225,226],{},"The single idea that makes Rust memory-safe without a garbage collector.",[76,228,229,232,238],{},[94,230,231],{},"08",[94,233,234],{},[100,235,237],{"href":236},"\u002Frust\u002F08-references-and-borrowing","References & Borrowing",[94,239,240],{},"The borrow checker's aliasing rules are the most common source of \"fighting the compiler.\"",[76,242,243,246,252],{},[94,244,245],{},"09",[94,247,248],{},[100,249,251],{"href":250},"\u002Frust\u002F09-slices","Slices",[94,253,254],{},"String slices and array slices avoid needless allocation but come with lifetime constraints.",[76,256,257,260,266],{},[94,258,259],{},"10",[94,261,262],{},[100,263,265],{"href":264},"\u002Frust\u002F10-lifetimes","Lifetimes",[94,267,268],{},"Lifetime elision rules and explicit annotations are the most-feared, most-misunderstood feature.",[65,270,272],{"id":271},"part-3-data-abstraction","Part 3 — Data & Abstraction",[70,274,275,285],{},[73,276,277],{},[76,278,279,281,283],{},[79,280,81],{},[79,282,84],{},[79,284,87],{},[89,286,287,312,333,347,367,381,402],{},[76,288,289,292,298],{},[94,290,291],{},"11",[94,293,294],{},[100,295,297],{"href":296},"\u002Frust\u002F11-structs","Structs",[94,299,300,301,304,305,304,308,311],{},"Struct update syntax and method receivers (",[49,302,303],{},"self"," vs ",[49,306,307],{},"&self",[49,309,310],{},"&mut self",") shape ergonomic APIs.",[76,313,314,317,323],{},[94,315,316],{},"12",[94,318,319],{},[100,320,322],{"href":321},"\u002Frust\u002F12-enums","Enums",[94,324,325,328,329,332],{},[49,326,327],{},"Option"," and ",[49,330,331],{},"Result"," are enums — understanding variants unlocks idiomatic error handling.",[76,334,335,338,344],{},[94,336,337],{},"13",[94,339,340],{},[100,341,343],{"href":342},"\u002Frust\u002F13-pattern-matching","Pattern Matching",[94,345,346],{},"Exhaustiveness checks and guard clauses catch bugs at compile time other languages miss.",[76,348,349,352,358],{},[94,350,351],{},"14",[94,353,354],{},[100,355,357],{"href":356},"\u002Frust\u002F14-collections","Collections",[94,359,360,186,363,366],{},[49,361,362],{},"Vec",[49,364,365],{},"HashMap",", and entry APIs are the daily-driver data structures.",[76,368,369,372,378],{},[94,370,371],{},"15",[94,373,374],{},[100,375,377],{"href":376},"\u002Frust\u002F15-iterators","Iterators",[94,379,380],{},"Laziness, zero-cost abstraction claims, and adapter chaining are frequently misunderstood.",[76,382,383,386,392],{},[94,384,385],{},"16",[94,387,388],{},[100,389,391],{"href":390},"\u002Frust\u002F16-traits-and-generics","Traits & Generics",[94,393,394,395,304,398,401],{},"Trait bounds, ",[49,396,397],{},"dyn",[49,399,400],{},"impl Trait",", and monomorphization drive Rust's polymorphism model.",[76,403,404,407,413],{},[94,405,406],{},"17",[94,408,409],{},[100,410,412],{"href":411},"\u002Frust\u002F17-closures","Closures",[94,414,415,418,419,418,422,425],{},[49,416,417],{},"Fn","\u002F",[49,420,421],{},"FnMut",[49,423,424],{},"FnOnce"," and capture-by-move are common sources of compiler errors.",[65,427,429],{"id":428},"part-4-robustness-concurrency","Part 4 — Robustness & Concurrency",[70,431,432,442],{},[73,433,434],{},[76,435,436,438,440],{},[79,437,81],{},[79,439,84],{},[79,441,87],{},[89,443,444,467,490,511,529,549],{},[76,445,446,449,455],{},[94,447,448],{},"18",[94,450,451],{},[100,452,454],{"href":453},"\u002Frust\u002F18-error-handling","Error Handling",[94,456,457,460,461,304,464,466],{},[49,458,459],{},"?"," propagation, ",[49,462,463],{},"panic!",[49,465,331],{},", and error trait objects define idiomatic reliability.",[76,468,469,472,478],{},[94,470,471],{},"19",[94,473,474],{},[100,475,477],{"href":476},"\u002Frust\u002F19-smart-pointers","Smart Pointers",[94,479,480,186,483,186,486,489],{},[49,481,482],{},"Box",[49,484,485],{},"Rc",[49,487,488],{},"RefCell",", and interior mutability trade compile-time checks for runtime ones.",[76,491,492,495,501],{},[94,493,494],{},"20",[94,496,497],{},[100,498,500],{"href":499},"\u002Frust\u002F20-modules-and-crates","Modules & Crates",[94,502,503,504,186,507,510],{},"Visibility rules (",[49,505,506],{},"pub",[49,508,509],{},"pub(crate)",") and the module tree shape API design.",[76,512,513,516,522],{},[94,514,515],{},"21",[94,517,518],{},[100,519,521],{"href":520},"\u002Frust\u002F21-testing","Testing",[94,523,524,525,528],{},"Built-in ",[49,526,527],{},"#[test]",", integration tests, and doctests are core to Rust's reliability culture.",[76,530,531,534,540],{},[94,532,533],{},"22",[94,535,536],{},[100,537,539],{"href":538},"\u002Frust\u002F22-concurrency","Concurrency",[94,541,542,418,545,548],{},[49,543,544],{},"Send",[49,546,547],{},"Sync"," and ownership transfer make Rust's \"fearless concurrency\" claim concrete.",[76,550,551,554,560],{},[94,552,553],{},"23",[94,555,556],{},[100,557,559],{"href":558},"\u002Frust\u002F23-async-await","Async\u002FAwait",[94,561,562],{},"Futures are lazy and runtime-agnostic — a frequent source of \"why didn't this run\" bugs.",[65,564,566],{"id":565},"part-5-metaprogramming-systems","Part 5 — Metaprogramming & Systems",[70,568,569,579],{},[73,570,571],{},[76,572,573,575,577],{},[79,574,81],{},[79,576,84],{},[79,578,87],{},[89,580,581,599,613,631,645],{},[76,582,583,586,592],{},[94,584,585],{},"24",[94,587,588],{},[100,589,591],{"href":590},"\u002Frust\u002F24-macros","Macros",[94,593,594,595,598],{},"Declarative (",[49,596,597],{},"macro_rules!",") vs. procedural macros power much of the ecosystem's ergonomics.",[76,600,601,604,610],{},[94,602,603],{},"25",[94,605,606],{},[100,607,609],{"href":608},"\u002Frust\u002F25-unsafe-rust","Unsafe Rust",[94,611,612],{},"Raw pointers and manual invariants are where Rust's safety guarantees can be broken.",[76,614,615,618,624],{},[94,616,617],{},"26",[94,619,620],{},[100,621,623],{"href":622},"\u002Frust\u002F26-ffi","FFI",[94,625,626,627,630],{},"Calling into C and ",[49,628,629],{},"#[repr(C)]"," layout guarantees are essential for systems interop.",[76,632,633,636,642],{},[94,634,635],{},"27",[94,637,638],{},[100,639,641],{"href":640},"\u002Frust\u002F27-attributes-and-cfg","Attributes & Cfg",[94,643,644],{},"Conditional compilation and derive macros are pervasive in real crates.",[76,646,647,650,656],{},[94,648,649],{},"28",[94,651,652],{},[100,653,655],{"href":654},"\u002Frust\u002F28-cargo-features","Cargo Features",[94,657,658],{},"Feature flags and unification pitfalls affect every multi-crate workspace.",[65,660,662],{"id":661},"part-6-expert-professional","Part 6 — Expert & Professional",[70,664,665,675],{},[73,666,667],{},[76,668,669,671,673],{},[79,670,81],{},[79,672,84],{},[79,674,87],{},[89,676,677,691,705,723,737,762,776],{},[76,678,679,682,688],{},[94,680,681],{},"29",[94,683,684],{},[100,685,687],{"href":686},"\u002Frust\u002F29-advanced-type-system","Advanced Type System",[94,689,690],{},"Associated types, GATs, and variance explain why some generic code won't compile.",[76,692,693,696,702],{},[94,694,695],{},"30",[94,697,698],{},[100,699,701],{"href":700},"\u002Frust\u002F30-design-patterns","Design Patterns",[94,703,704],{},"Builder, newtype, and typestate patterns are how Rust expresses OOP-style designs.",[76,706,707,710,716],{},[94,708,709],{},"31",[94,711,712],{},[100,713,715],{"href":714},"\u002Frust\u002F31-performance","Performance",[94,717,718,719,722],{},"Allocation patterns, ",[49,720,721],{},"#[inline]",", and benchmarking pitfalls matter for systems-level code.",[76,724,725,728,734],{},[94,726,727],{},"32",[94,729,730],{},[100,731,733],{"href":732},"\u002Frust\u002F32-documentation","Documentation",[94,735,736],{},"Doc comments and doctests double as both documentation and executable tests.",[76,738,739,742,748],{},[94,740,741],{},"33",[94,743,744],{},[100,745,747],{"href":746},"\u002Frust\u002F33-ecosystem","Ecosystem",[94,749,750,751,186,754,757,758,761],{},"Knowing ",[49,752,753],{},"serde",[49,755,756],{},"tokio",", and ",[49,759,760],{},"clippy"," conventions is table stakes for real Rust work.",[76,763,764,767,773],{},[94,765,766],{},"34",[94,768,769],{},[100,770,772],{"href":771},"\u002Frust\u002F34-common-pitfalls","Common Pitfalls",[94,774,775],{},"A curated set of the mistakes that trip up developers moving from GC'd languages.",[76,777,778,781,787],{},[94,779,780],{},"35",[94,782,783],{},[100,784,786],{"href":785},"\u002Frust\u002F35-exercises-and-projects","Exercises & Projects (Capstone)",[94,788,789],{},"A mixed-review capstone spanning ownership, traits, error handling, and concurrency.",{"title":791,"searchDepth":792,"depth":792,"links":793},"",2,[794,795,796],{"id":20,"depth":792,"text":21},{"id":55,"depth":792,"text":56},{"id":62,"depth":792,"text":63,"children":797},[798,800,801,802,803,804],{"id":67,"depth":799,"text":68},3,{"id":197,"depth":799,"text":198},{"id":271,"depth":799,"text":272},{"id":428,"depth":799,"text":429},{"id":565,"depth":799,"text":566},{"id":661,"depth":799,"text":662},"md",{},true,"\u002Frust",{"title":5,"description":16},"rust\u002Findex","LQ1sk13TzR00r98GzXhiwPQ-Red44ABd6vhE-pQtZp4",1787335398489]