Loading tutorials
(10, 2.5, "origin"). It also assumes you know what let mut does and what & and &mut mean. It covers reading and writing individual tuple fields by position, the rules that restrict that syntax, and the errors you4 min read.0, and use let, match, and references in basic Rust. Here you will see how a pattern on the left side of let takes a tuple apart, and where else Rust accepts the same patterns.4 min readOption and Result at a basic level, and know that a tuple is a fixed group of values with .0 and .1 access and let (a, b) = ... destructuring. Here you will use those tuple features to return more than one result from a function. You w4 min read(i32, f64), and can read Result<T, E> and Option<T> types. It covers the smallest tuples: the one with zero elements, (), and the one with one element, (T,). Both look like edge cases. Both show up i5 min read.0, and destructure them. It also assumes you know what a trait is and what derive does. Here you will see which standard traits tuples already implement, when they implement them, and where that stops being enough.3 min readi32, f64, bool, char), understand & borrowing, and can run programs with cargo. It covers what an array is and how its type works. Indexing, iteration, slices, and Vec get their own chapters.4 min read[T; N], and can run programs with cargo. It covers the [value; N] syntax, the rules for which values it accepts, and what to use when it refuses your element type.4 min readcargo, and that you know how to declare an array such as [u32; 5]. It covers how indexing works, when it fails, and which tool to use for each kind of failure.4 min readfor loop, know the difference between &T and &mut T, and understand moves and the Copy trait at a basic level. It also assumes you are compiling with Rust 2021 or later. You will learn the three ways to loop over an array, what item type each one produces4 min read& references, &mut references, and closures. Here you will learn where array methods come from, which ones you will use most often, and the mista4 min read[value; N] means. It also assumes you can borrow with & and &mut. Here you will build two-dimensional grids from arrays, read the type annotations, and avoid the usual mistakes with initialization and4 min read[T; N] array type, and understand shared (&) and mutable (&mut) references. It builds on array indexing and get. It leads into slice patterns and the choice between array, slice, and Vec.4 min readmatch on enums and tuples, and that you know the difference between [T; N], &[T], and Vec<T>. Slice patterns build on the destructuring you already used with tuples. The new part is that a slice's length is not known at compile time.3 min read[T; N] includes its length, that slices (&[T]) borrow a view of an array, and that functions can take type parameters such as <T>. Const generics let a function or type take the length N as a parameter, the way Vec<T> takes T.4 min read&[T] borrowing works, and how to run programs with cargo. It covers the standard library type you reach for when the number of elements is not known until the program runs.4 min readVec behave. It also assumes you know what & references do. Here you will see how those types sit in memory, what that costs, and where the guarantees stop.4 min read&[T], and create a Vec. It focuses on how to pick among tuples, arrays, slices, and Vec, and on the mistakes that picking wrongly causes.5 min read