Loading tutorials
impl Trait for Type means, and how println! format strings work.2 min readimpl Trait for Type works, and how to use println! with format strings. It covers the Debug trait: what it is for, how to get it with derive, and the two output shapes it offers.2 min read#[derive(Debug)] works and can read a println! format string. It covers the two output shapes that Debug produces and when to use each.2 min read#[derive(Debug)] works, how impl Trait for Type is written, and how println! format strings behave. Here you will write Debug yourself and see when that is worth doing.2 min readimpl Trait for Type works, and how to use println! format strings. It also assumes you have seen #[derive(Debug)] and {:?}.2 min readimpl Trait for Type, you know println! format strings, and you have implemented Display for a type (previous chapter).2 min readimpl fmt::Display for T with write!, and that you know format specs such as {:>8} and {:.2}.1 min readimpl Trait for Type, how match works on enums, and the basics of Result. You should also have seen Display on a simple struct. Here you apply it to errors.2 min readimpl Trait for Type, and basic Result handling. It covers how to define a conversion with From. The next chapters cover Into and the ? operator in detail.2 min readimpl Trait for Type works, how ownership moves values, and how From is defined. Here you will see how Into relates to From and how to use it in your own code.2 min readResult, match, and how to write impl Trait for Type. It also assumes you have seen From as a conversion trait. Here you will see how ? uses From to convert errors for you.2 min readFrom and Into work, how Result and ? behave, and how to implement Display for an error type.2 min readimpl Trait for Type and use println! with {:?}. It also assumes you know basic structs and Option.2 min read#[derive(...)] works and what the Default trait is: a default() function that returns a standard initial value for a type. It also assumes you can read basic structs and enums.2 min read#[derive(Default)] or an impl Default for ... block. Here you will combine a Default implementation with struct update syntax, so you set only the fields you care about.2 min readimpl Trait for Type works, how println! format strings behave, and how Result and ? are used. Here you will pick the right trait for each job and see all four traits working in one small program.2 min read