[{"data":1,"prerenderedAt":1088},["ShallowReactive",2],{"page-\u002Frust":3},{"id":4,"title":5,"body":6,"description":1080,"extension":1081,"meta":1082,"navigation":1083,"path":1084,"seo":1085,"stem":1086,"__hash__":1087},"content\u002Frust\u002Findex.md","Learn Rust — From Zero to Pro",{"type":7,"value":8,"toc":1055},"minimark",[9,14,18,23,56,60,80,84,89,227,231,326,330,419,423,527,531,615,619,674,678,749,753,910,914,918,932,936,939,943,955,959,962,966,1031,1035,1045,1049,1052],[10,11,13],"h1",{"id":12},"learn-rust-from-zero-to-pro","🦀 Learn Rust — From Zero to Pro",[15,16,17],"p",{},"A comprehensive, edge-case-covering, idiomatic Rust curriculum. Each document is self-contained and covers its concept deeply enough that a careful reader can go from beginner to pro Rust developer.",[19,20,22],"h2",{"id":21},"how-to-use-this-course","How to Use This Course",[24,25,26,34,40,46],"ol",{},[27,28,29,33],"li",{},[30,31,32],"strong",{},"Read sequentially"," for a structured path (01 → 35).",[27,35,36,39],{},[30,37,38],{},"Jump to a chapter"," as a reference when you hit a concept in the wild.",[27,41,42,45],{},[30,43,44],{},"Run the exercises"," in chapter 35 after every few chapters.",[27,47,48,55],{},[30,49,50,51],{},"Read the source of std and ",[52,53,54],"code",{},"tokio"," alongside.",[19,57,59],{"id":58},"prerequisites","Prerequisites",[61,62,63,70,77],"ul",{},[27,64,65,66,69],{},"A working Rust toolchain (",[52,67,68],{},"rustup",").",[27,71,72,73,76],{},"A code editor (VS Code + ",[52,74,75],{},"rust-analyzer"," recommended).",[27,78,79],{},"Comfort with at least one other programming language.",[19,81,83],{"id":82},"curriculum","Curriculum",[85,86,88],"h3",{"id":87},"part-i-foundations","Part I — Foundations",[90,91,92,108],"table",{},[93,94,95],"thead",{},[96,97,98,102,105],"tr",{},[99,100,101],"th",{},"#",[99,103,104],{},"Topic",[99,106,107],{},"Why It Matters",[109,110,111,127,144,166,180,197],"tbody",{},[96,112,113,117,124],{},[114,115,116],"td",{},"01",[114,118,119],{},[120,121,123],"a",{"href":122},"\u002Frust\u002F01-introduction-and-setup","Introduction & Setup",[114,125,126],{},"Toolchain, cargo, project layout.",[96,128,129,132,138],{},[114,130,131],{},"02",[114,133,134],{},[120,135,137],{"href":136},"\u002Frust\u002F02-hello-world-and-cargo","Hello World & Cargo Deep Dive",[114,139,140,143],{},[52,141,142],{},"Cargo.toml",", dependencies, workspaces.",[96,145,146,149,155],{},[114,147,148],{},"03",[114,150,151],{},[120,152,154],{"href":153},"\u002Frust\u002F03-variables-and-mutability","Variables & Mutability",[114,156,157,158,161,162,165],{},"Immutability, shadowing, ",[52,159,160],{},"const",", ",[52,163,164],{},"static",".",[96,167,168,171,177],{},[114,169,170],{},"04",[114,172,173],{},[120,174,176],{"href":175},"\u002Frust\u002F04-data-types","Data Types",[114,178,179],{},"Integers, floats, char, tuples, arrays, casts.",[96,181,182,185,191],{},[114,183,184],{},"05",[114,186,187],{},[120,188,190],{"href":189},"\u002Frust\u002F05-functions","Functions",[114,192,193,194,165],{},"Statements vs expressions, divergence, ",[52,195,196],{},"impl",[96,198,199,202,208],{},[114,200,201],{},"06",[114,203,204],{},[120,205,207],{"href":206},"\u002Frust\u002F06-control-flow","Control Flow",[114,209,210,213,214,213,217,213,220,213,223,226],{},[52,211,212],{},"if","\u002F",[52,215,216],{},"while",[52,218,219],{},"for",[52,221,222],{},"loop",[52,224,225],{},"match"," as expressions.",[85,228,230],{"id":229},"part-ii-ownership-borrowing-the-heart-of-rust","Part II — Ownership & Borrowing (The Heart of Rust)",[90,232,233,243],{},[93,234,235],{},[96,236,237,239,241],{},[99,238,101],{},[99,240,104],{},[99,242,107],{},[109,244,245,265,285,305],{},[96,246,247,250,256],{},[114,248,249],{},"07",[114,251,252],{},[120,253,255],{"href":254},"\u002Frust\u002F07-ownership","Ownership",[114,257,258,259,161,262,165],{},"Move semantics, ",[52,260,261],{},"Drop",[52,263,264],{},"Copy",[96,266,267,270,276],{},[114,268,269],{},"08",[114,271,272],{},[120,273,275],{"href":274},"\u002Frust\u002F08-references-and-borrowing","References & Borrowing",[114,277,278,213,281,284],{},[52,279,280],{},"&T",[52,282,283],{},"&mut T",", NLL, borrow rules.",[96,286,287,290,296],{},[114,288,289],{},"09",[114,291,292],{},[120,293,295],{"href":294},"\u002Frust\u002F09-slices","Slices",[114,297,298,161,301,304],{},[52,299,300],{},"&[T]",[52,302,303],{},"&str",", fat pointers.",[96,306,307,310,316],{},[114,308,309],{},"10",[114,311,312],{},[120,313,315],{"href":314},"\u002Frust\u002F10-lifetimes","Lifetimes",[114,317,318,321,322,325],{},[52,319,320],{},"'a",", elision, ",[52,323,324],{},"'static",", variance.",[85,327,329],{"id":328},"part-iii-modeling-data","Part III — Modeling Data",[90,331,332,342],{},[93,333,334],{},[96,335,336,338,340],{},[99,337,101],{},[99,339,104],{},[99,341,107],{},[109,343,344,361,382,396],{},[96,345,346,349,355],{},[114,347,348],{},"11",[114,350,351],{},[120,352,354],{"href":353},"\u002Frust\u002F11-structs","Structs",[114,356,357,358,360],{},"Named\u002Ftuple\u002Funit, ",[52,359,196],{},", derives.",[96,362,363,366,372],{},[114,364,365],{},"12",[114,367,368],{},[120,369,371],{"href":370},"\u002Frust\u002F12-enums","Enums",[114,373,374,375,161,378,381],{},"ADTs, ",[52,376,377],{},"Option",[52,379,380],{},"Result",", niche optimization.",[96,383,384,387,393],{},[114,385,386],{},"13",[114,388,389],{},[120,390,392],{"href":391},"\u002Frust\u002F13-pattern-matching","Pattern Matching",[114,394,395],{},"All pattern forms, binding modes, guards.",[96,397,398,401,407],{},[114,399,400],{},"14",[114,402,403],{},[120,404,406],{"href":405},"\u002Frust\u002F14-collections","Collections",[114,408,409,161,412,161,415,418],{},[52,410,411],{},"Vec",[52,413,414],{},"String",[52,416,417],{},"HashMap",", and friends.",[85,420,422],{"id":421},"part-iv-abstraction-reuse","Part IV — Abstraction & Reuse",[90,424,425,435],{},[93,426,427],{},[96,428,429,431,433],{},[99,430,101],{},[99,432,104],{},[99,434,107],{},[109,436,437,458,475,501],{},[96,438,439,442,448],{},[114,440,441],{},"15",[114,443,444],{},[120,445,447],{"href":446},"\u002Frust\u002F15-iterators","Iterators & Combinators",[114,449,450,451,454,455,165],{},"Zero-cost iteration, ",[52,452,453],{},"collect",", custom ",[52,456,457],{},"Iterator",[96,459,460,463,469],{},[114,461,462],{},"16",[114,464,465],{},[120,466,468],{"href":467},"\u002Frust\u002F16-traits-and-generics","Traits & Generics",[114,470,471,472,165],{},"Trait bounds, object safety, ",[52,473,474],{},"impl Trait",[96,476,477,480,486],{},[114,478,479],{},"17",[114,481,482],{},[120,483,485],{"href":484},"\u002Frust\u002F17-closures","Closures",[114,487,488,213,491,213,494,497,498,165],{},[52,489,490],{},"Fn",[52,492,493],{},"FnMut",[52,495,496],{},"FnOnce",", capture, ",[52,499,500],{},"move",[96,502,503,506,512],{},[114,504,505],{},"18",[114,507,508],{},[120,509,511],{"href":510},"\u002Frust\u002F18-error-handling","Error Handling",[114,513,514,213,516,161,518,161,521,213,524,165],{},[52,515,380],{},[52,517,377],{},[52,519,520],{},"?",[52,522,523],{},"thiserror",[52,525,526],{},"anyhow",[85,528,530],{"id":529},"part-v-memory-organization","Part V — Memory & Organization",[90,532,533,543],{},[93,534,535],{},[96,536,537,539,541],{},[99,538,101],{},[99,540,104],{},[99,542,107],{},[109,544,545,579,597],{},[96,546,547,550,556],{},[114,548,549],{},"19",[114,551,552],{},[120,553,555],{"href":554},"\u002Frust\u002F19-smart-pointers","Smart Pointers",[114,557,558,213,561,213,564,213,567,213,570,213,573,213,576,165],{},[52,559,560],{},"Box",[52,562,563],{},"Rc",[52,565,566],{},"Arc",[52,568,569],{},"RefCell",[52,571,572],{},"Mutex",[52,574,575],{},"Cow",[52,577,578],{},"Pin",[96,580,581,584,590],{},[114,582,583],{},"20",[114,585,586],{},[120,587,589],{"href":588},"\u002Frust\u002F20-modules-and-crates","Modules & Crates",[114,591,592,593,596],{},"Visibility, paths, ",[52,594,595],{},"use",", workspaces.",[96,598,599,602,608],{},[114,600,601],{},"21",[114,603,604],{},[120,605,607],{"href":606},"\u002Frust\u002F21-testing","Testing",[114,609,610,611,614],{},"Unit\u002Fintegration\u002Fdoc tests, ",[52,612,613],{},"criterion",", fuzzing.",[85,616,618],{"id":617},"part-vi-concurrency-async","Part VI — Concurrency & Async",[90,620,621,631],{},[93,622,623],{},[96,624,625,627,629],{},[99,626,101],{},[99,628,104],{},[99,630,107],{},[109,632,633,653],{},[96,634,635,638,644],{},[114,636,637],{},"22",[114,639,640],{},[120,641,643],{"href":642},"\u002Frust\u002F22-concurrency","Concurrency & Multithreading",[114,645,646,213,649,652],{},[52,647,648],{},"Send",[52,650,651],{},"Sync",", threads, channels, atomics.",[96,654,655,658,664],{},[114,656,657],{},"23",[114,659,660],{},[120,661,663],{"href":662},"\u002Frust\u002F23-async-await","Async \u002F Await",[114,665,666,667,670,671,165],{},"Futures, runtimes, ",[52,668,669],{},"select!",", streams, ",[52,672,673],{},"spawn_blocking",[85,675,677],{"id":676},"part-vii-metaprogramming","Part VII — Metaprogramming",[90,679,680,690],{},[93,681,682],{},[96,683,684,686,688],{},[99,685,101],{},[99,687,104],{},[99,689,107],{},[109,691,692,712,729],{},[96,693,694,697,703],{},[114,695,696],{},"24",[114,698,699],{},[120,700,702],{"href":701},"\u002Frust\u002F24-macros","Macros",[114,704,705,708,709,165],{},[52,706,707],{},"macro_rules!",", proc-macros, ",[52,710,711],{},"cargo expand",[96,713,714,717,723],{},[114,715,716],{},"25",[114,718,719],{},[120,720,722],{"href":721},"\u002Frust\u002F25-unsafe-rust","Unsafe Rust",[114,724,725,726,165],{},"Raw pointers, FFI, soundness, ",[52,727,728],{},"Miri",[96,730,731,734,740],{},[114,732,733],{},"26",[114,735,736],{},[120,737,739],{"href":738},"\u002Frust\u002F26-ffi","FFI",[114,741,742,743,213,746,165],{},"Calling C, calling Rust from C, ",[52,744,745],{},"bindgen",[52,747,748],{},"cxx",[85,750,752],{"id":751},"part-viii-production-engineering","Part VIII — Production Engineering",[90,754,755,765],{},[93,756,757],{},[96,758,759,761,763],{},[99,760,101],{},[99,762,104],{},[99,764,107],{},[109,766,767,790,804,818,832,851,868,882,896],{},[96,768,769,772,778],{},[114,770,771],{},"27",[114,773,774],{},[120,775,777],{"href":776},"\u002Frust\u002F27-attributes-and-cfg","Attributes & Conditional Compilation",[114,779,780,161,783,786,787,165],{},[52,781,782],{},"#[cfg]",[52,784,785],{},"#[derive]",", lints, ",[52,788,789],{},"#[non_exhaustive]",[96,791,792,795,801],{},[114,793,794],{},"28",[114,796,797],{},[120,798,800],{"href":799},"\u002Frust\u002F28-cargo-features","Cargo Features & Release Engineering",[114,802,803],{},"Features, profiles, CI, publishing.",[96,805,806,809,815],{},[114,807,808],{},"29",[114,810,811],{},[120,812,814],{"href":813},"\u002Frust\u002F29-advanced-type-system","Advanced Type System",[114,816,817],{},"Variance, HRTBs, GATs, const generics.",[96,819,820,823,829],{},[114,821,822],{},"30",[114,824,825],{},[120,826,828],{"href":827},"\u002Frust\u002F30-design-patterns","Design Patterns & Idiomatic Rust",[114,830,831],{},"Builder, typestate, newtype, RAII.",[96,833,834,837,843],{},[114,835,836],{},"31",[114,838,839],{},[120,840,842],{"href":841},"\u002Frust\u002F31-performance","Performance, Profiling & Optimization",[114,844,845,161,847,850],{},[52,846,613],{},[52,848,849],{},"flamegraph",", allocation pitfalls.",[96,852,853,856,862],{},[114,854,855],{},"32",[114,857,858],{},[120,859,861],{"href":860},"\u002Frust\u002F32-documentation","Documentation",[114,863,864,867],{},[52,865,866],{},"rustdoc",", doc tests, intra-doc links.",[96,869,870,873,879],{},[114,871,872],{},"33",[114,874,875],{},[120,876,878],{"href":877},"\u002Frust\u002F33-ecosystem","Ecosystem Tour",[114,880,881],{},"Curated map of crates for every domain.",[96,883,884,887,893],{},[114,885,886],{},"34",[114,888,889],{},[120,890,892],{"href":891},"\u002Frust\u002F34-common-pitfalls","Common Pitfalls & Idiomatic Fixes",[114,894,895],{},"40+ traps and their fixes.",[96,897,898,901,907],{},[114,899,900],{},"35",[114,902,903],{},[120,904,906],{"href":905},"\u002Frust\u002F35-exercises-and-projects","Exercises & Project Ideas",[114,908,909],{},"From beginner to pro.",[19,911,913],{"id":912},"learning-path-suggestions","Learning Path Suggestions",[85,915,917],{"id":916},"if-youre-new-to-systems-programming","If you're new to systems programming",[24,919,920,923,926,929],{},[27,921,922],{},"Read 01–14 in order.",[27,924,925],{},"Skip to 21 (Testing) and write tests for everything you've built.",[27,927,928],{},"Skim 15–18 and 22–23, then come back to the harder parts.",[27,930,931],{},"Do exercises 1–5 in chapter 35.",[85,933,935],{"id":934},"if-youre-coming-from-cc","If you're coming from C\u002FC++",[15,937,938],{},"Read 07–10 carefully (ownership is the new mental model). Skim 04 (data types) — you'll find surprises (char is 4 bytes). Read 25 (Unsafe) to understand what Rust adds over C. Then 22 and 23.",[85,940,942],{"id":941},"if-youre-coming-from-pythonjsruby","If you're coming from Python\u002FJS\u002FRuby",[15,944,945,946,213,948,950,951,954],{},"Ownership will be new. Read 03–10 slowly. Don't skip 18 (Error Handling) — ",[52,947,380],{},[52,949,520],{}," is the culture. Don't reach for ",[52,952,953],{},"clone"," reflexively.",[85,956,958],{"id":957},"if-youre-a-senior-engineer-learning-rust-for-production","If you're a senior engineer learning Rust for production",[15,960,961],{},"Skim 01–14. Read 16, 18, 22, 23, 27, 28 closely. Use 30, 34 as references. Skim 33 for the crate landscape. Then read 35 and pick a project.",[19,963,965],{"id":964},"companion-resources","Companion Resources",[61,967,968,977,985,993,1001,1009,1017],{},[27,969,970,976],{},[120,971,975],{"href":972,"rel":973},"https:\u002F\u002Fdoc.rust-lang.org\u002Fbook\u002F",[974],"nofollow","The Rust Book"," — official, free.",[27,978,979,984],{},[120,980,983],{"href":981,"rel":982},"https:\u002F\u002Fdoc.rust-lang.org\u002Frust-by-example\u002F",[974],"Rust by Example"," — code-first.",[27,986,987,992],{},[120,988,991],{"href":989,"rel":990},"https:\u002F\u002Fdoc.rust-lang.org\u002Freference\u002F",[974],"Rust Reference"," — language spec.",[27,994,995,1000],{},[120,996,999],{"href":997,"rel":998},"https:\u002F\u002Fdoc.rust-lang.org\u002Fnomicon\u002F",[974],"Rustonomicon"," — unsafe Rust deep dive.",[27,1002,1003,1008],{},[120,1004,1007],{"href":1005,"rel":1006},"https:\u002F\u002Frust-lang.github.io\u002Fasync-book\u002F",[974],"Async Book"," — async internals.",[27,1010,1011,1016],{},[120,1012,1015],{"href":1013,"rel":1014},"https:\u002F\u002Fwww.youtube.com\u002Fplaylist?list=PLqbS7AVKE3Wy6jX6h_AjMpwL9t1ZckhnH",[974],"Jon Gjengset's Crust of Rust"," — YouTube deep dives.",[27,1018,1019,1024,1025,1030],{},[120,1020,1023],{"href":1021,"rel":1022},"https:\u002F\u002Freddit.com\u002Fr\u002Frust",[974],"r\u002Frust"," and ",[120,1026,1029],{"href":1027,"rel":1028},"https:\u002F\u002Fusers.rust-lang.org",[974],"users.rust-lang.org"," — community.",[19,1032,1034],{"id":1033},"tooling-to-install","Tooling to Install",[1036,1037,1043],"pre",{"className":1038,"code":1040,"language":1041,"meta":1042},[1039],"language-bash","rustup component add rustfmt clippy rust-src rust-analyzer\ncargo install cargo-expand cargo-nextest cargo-deny cargo-audit \\\n    cargo-flamegraph cargo-bloat cargo-machete cargo-release \\\n    samply cargo-watch mdbook\n","bash","",[52,1044,1040],{"__ignoreMap":1042},[19,1046,1048],{"id":1047},"license","License",[15,1050,1051],{},"These notes are yours to use, share, and modify.",[15,1053,1054],{},"🦀",{"title":1042,"searchDepth":1056,"depth":1056,"links":1057},2,[1058,1059,1060,1071,1077,1078,1079],{"id":21,"depth":1056,"text":22},{"id":58,"depth":1056,"text":59},{"id":82,"depth":1056,"text":83,"children":1061},[1062,1064,1065,1066,1067,1068,1069,1070],{"id":87,"depth":1063,"text":88},3,{"id":229,"depth":1063,"text":230},{"id":328,"depth":1063,"text":329},{"id":421,"depth":1063,"text":422},{"id":529,"depth":1063,"text":530},{"id":617,"depth":1063,"text":618},{"id":676,"depth":1063,"text":677},{"id":751,"depth":1063,"text":752},{"id":912,"depth":1056,"text":913,"children":1072},[1073,1074,1075,1076],{"id":916,"depth":1063,"text":917},{"id":934,"depth":1063,"text":935},{"id":941,"depth":1063,"text":942},{"id":957,"depth":1063,"text":958},{"id":964,"depth":1056,"text":965},{"id":1033,"depth":1056,"text":1034},{"id":1047,"depth":1056,"text":1048},"A comprehensive, edge-case-covering, idiomatic Rust curriculum. 35 chapters covering ownership, borrowing, lifetimes, traits, generics, closures, async, macros, FFI, and more. Go from beginner to pro Rust developer.","md",{},true,"\u002Frust",{"title":5,"description":1080},"rust\u002Findex","zWuY4j1jUxw36iawCP21nn_Uo4sPrgXARPE_ygGVSS4",1785935255577]