Loading tutorials
&, &mut), that you can read Option and match, and that you can run programs with cargo run. Every example is a complete main.rs 5 min read&, &mut), Option and match, and how to run programs with cargo. You have already seen how to create a Vec<T> and grow it with push. Here you will learn the two main ways to read an element back, and when to4 min readVec<T>: by shared reference, by mutable reference, and by value. It also covers how a for loop is built on iterators, how to get indices alongside elements, and the mistakes that cause compiler errors. It assumes you know basic Rust syntax, the r5 min read&, &mut), you can read Option and match, and you can run programs with cargo. It builds on creating a Vec, reading it with indexing or get, and iterating over it.5 min readVec, push to it, and read from it with indexing or get. It also assumes you know & and &mut borrowing and how closures are written. The methods here change a Vec in place, so each one needs a mut binding. Each has a cost and a failure mode worth know4 min readVec, read elements with indexing and get, and iterate over it. It also assumes you know the basic borrowing rules: any number of & borrows, or one &mut, never both at once.4 min readVec<T> holds elements of exactly one type. Real data is often mixed: a spreadsheet row with numbers and text, a list of parsed tokens, a queue of commands. This chapter shows how to model that with an enum, how to read and change the values, and when to use trait objects instead.4 min readVec<T> manages its memory. It assumes you can create a Vec, push to it, and read the basics of ownership and borrowing. You should also know how to run a program with cargo.5 min readHashMap<K, V> operations: creating a map, inserting, reading, updating and removing entries. It assumes you know basic Rust syntax, ownership and borrowing (move, &, &mut), Option and match, and how to run programs with cargo. You should also have seen `Vec<T4 min read& and &mut references, Option and match, and the basic HashMap calls insert, get and remove. Here you will learn who owns the data after each of those calls, and why the compiler sometimes rejects code that looks harmless.4 min read& and &mut), and read Option and match. It also assumes you know how to create a HashMap and call insert, get and remove. You will use the entry API to update a value in place, or create it if it is missing,4 min readHashMap, insert and read entries, and write a for loop over a Vec. It also assumes you know the difference between &, &mut and moving a value. A HashMap<K, V> can be walked in several ways. The method you pick decides whether you see keys, values or 4 min read#[derive], and the HashMap operations from the earlier chapters (insert, get, entry). It explains which types can be keys, why the compiler asks for those traits, and how to write the traits by hand when `derive5 min readiter, map, filter), understand Option and Result, and know how Vec and HashMap store data. It covers how collect decides what to build, how to build the common collections, and which errors you will meet.3 min readHashMap, including the entry API. It also assumes you know how to derive Eq and Hash for a key type and have a working grasp of traits and generics. Here you will see what happens between map.insert(key, value) and the moment the entry lands in memory. You wi5 min readVec and a HashMap, use get and the entry API, and read Option results with match. It also assumes you know what Eq and Hash mean for keys. Here you will pick one collection for a task by looking at how the program uses the data.6 min read