Loading tutorials
match. You should know what ownership and borrowing mean at a basic level. You should also be able to create and run a project with Cargo.3 min readmatch works on enums, and how to build and run a project with Cargo. You should also have met Result and Option in the previous chapter. Here you will learn what unwrap and expect do, what a panic is, and when a panic is the right choice3 min readResult<T, E> and Option<T>, can read a match expression, and understand closures such as |e| e.to_string(). The ? operator comes in the next chapters. First you need to see the manual code that ? replaces.2 min readResult<T, E> and Option<T> work, how to use match, and why unwrap can panic. You should also be able to run a Cargo project. Here we use ? on Result. Later chapters cover Option and error conversion in more detail.2 min readmatch expressions and know that Result<T, E> has the variants Ok(T) and Err(E). You should also know that From is a trait for converting one type into another. The goal is to see that ? is shorthand for code you could write yourself.2 min read? returns early on Err and how to define an enum and implement a trait for it. It covers the conversion step that ? performs on the error value.2 min readOption<T> and match, and have used ? on Result. If not, review the earlier chapters on those topics first.2 min readResult, Option, and the basic ? operator on each. It also assumes you can read closures such as || value.2 min readmatch, can implement a trait for a type, and have used ? on Result values. It also assumes you know that ? converts errors through the From trait, which the previous chapter covered.2 min readResult, the ? operator, the From trait, and how to write a custom error enum with Display and Error implementations. You should also be comfortable with the basics of traits and ownership.2 min read? propagates errors, how the From trait converts error types, and how Box<dyn Error> works as a catch-all. Here you will put those pieces together at the top of a program.3 min readResult and Option, can write a function that uses ?, and understand the From trait. Here you will learn the compiler errors that ? causes most often, and the places where ? cannot be used.3 min read? works on Result, how From converts errors, and the basics of iterators and closures. Here you will learn how to turn many fallible operations into one Result.2 min read? uses From to convert errors, how to write a custom error enum with Display, Error, and From, and how Box<dyn Error> works. You also need to be able to add a dependency with Cargo.2 min read