Loading tutorials
impl Trait for Type block, as covered in the previous chapter. You should also be comfortable with &self receivers and String formatting.4 min readVec<T> and Option<T>, and the ownership rules for moving and copying values.4 min readT: Display, and how closures and iterators work at a basic level. impl Trait is shorter syntax for some of those bounds. In return position it also does something generics cannot do4 min readfn largest<T: PartialOrd + Copy>(items: &[T]) -> T. You should also be able to build and run a small program with cargo. Here you will see what the compiler does with a generic function, why that makes the call fast, and wha4 min readBox<dyn Trait> looks like. It covers the rules that decide whether dyn Trait is allowed. These rules are called dyn compatibility. Older documents call it object safety. You will also l5 min readT: Display) and have used Vec<T> and Option<T>. Here you learn the two ways a trait can mention another type, how to choose between them, and how to read 4 min readimpl blocks. Earlier chapters covered all three.4 min readT: Display. You should also know what dyn Trait is at a basic level. This chapter covers how one trait can require another.4 min readimpl block, and read a generic bound such as T: Clone. You should also know the basic ownership rules about moves and borrows.5 min readimpl block, read generic bounds like T: Add<Output = T>, and know the difference between moving and borrowing a value. You will learn how Rust turns operators into trait calls, how to implement the common operator traits for your own types, and w4 min readimpl<T: Bound> block. You should also know that a crate is one compilation unit, and that your program depends on other crates such as std.4 min readwhere clauses, and know the orphan rule from the previous chapter. It also assumes you have read the ch5 min readIterator to show how those pieces fit together in the standard library. You should also be comfortable with lifetimes in struct definitions for the borrowing example4 min readBox, Rc, and Arc at a basic level. You also need to know what a thread is and what ownership means for moves and borrows.5 min read