Loading tutorials
fn items. The followin5 min read|x| x + 1. The next chapters cover the move keyword and the Fn, FnMut and FnOnce traits. Here the question is narrower: when a closure uses a variable from the surroundin5 min readmove keyword changes, what it leaves alone, and the errors it prevents.5 min readF: Fn(i32) -> i32. Here you will learn how the compiler assigns each closure to one or more of three traits, and how to choo5 min readFn, FnMut and FnOnce traits from the previous chapter. Here you will write functions that take closures, choose the right bound, and fix the compiler errors that appear when the bound and the closure dis4 min readFn, FnMut and FnOnce traits, and basic generics and trait bounds. It also assumes you know what Box is. You will learn how to return closures from functions, which return type to pick, and what e5 min readOption, and how to use Vec and slices. It covers the one trait that every iterator chain in Rust rests on. Later chapters cover the individual variants (iter, iter_mut, into_iter), the adapters, and the5 min readVec and slices, and basic generics and trait bounds. You should also have seen the Iterator trait and its next method. Here we look at how a collection becomes an iterator, and why three methods exist for it.4 min readOption, and how to use Vec and slices. It also assumes you have read the chapters on closures and on the Iterator trait, including iter, iter_mut and into_iter.3 min readOption. You should also have met the Iterator trait and the common adapters such as map and filter. Here you will learn what "lazy" means for iterators, how to see it happen, and which errors it cause5 min readiter(), iter_mut() and into_iter() differ. It also assumes you know that adapters such as map and filter are lazy. Here we cover the methods that end a pipeline and produce a value.4 min readcollect, the consumer that turns an iterator back into a collection. It assumes you know the Iterator trait, adapters such as map and filter, generics with trait bounds, and Option and Result.4 min readFn, FnMut and FnOnce traits, the Iterator trait, and the common adapters and consumers. Here you combine them. You will see what the closures in a pipeline receive, how they capture state, and where the compiler pushes back.4 min readIterator trait and its next method, the difference between iter, iter_mut and into_iter, and basic lifetimes. You also need to be comfortable with Option and with adapters such as map and take. Here you will implement Iterator for your own types an5 min readfilter, map and sum usually compiles to the same machine code as a hand-written loop. It also covers where that stops being true. It assumes you know closures, the Fn traits, generics with trait bounds, and the common adapters and consumers (map, `5 min readOption and Result, and the closure and itera4 min read