Loading tutorials
Box, Rc, and RefCell in detail. This one explains the idea they share.2 min readBox<T>, the simplest smart pointer. Later chapters use it for recursive types and trait objects.2 min readBox<T> to define a type that contains itself.2 min readBox<T> and recursive types.2 min read*. It covers the Deref trait, which lets a smart pointer behave like a reference.2 min readDeref trait from the previous chapter. It covers how the compiler uses Deref to convert reference types automatically at call sites.2 min readDrop trait runs cleanup code and in what order values are dropped.2 min readBox<T> and the Deref and Drop traits from earlier chapters.2 min read&T and &mut T.2 min read&T, or exactly one &mut T), basic generics, and how Rc<T> shares ownership. It builds on the previous chapter's idea of interior mutability.2 min readRc<T> (shared ownership with a reference count) and RefCell<T> (borrow rules checked at runtime). Here you combine them.2 min readRefCell<T> and the idea of interior mutability: changing a value through a shared reference (&T). Cell<T> is a smaller tool for the same job.2 min readRc<T> counts owners, how RefCell<T> allows mutation through a shared reference, and how Drop runs when a value goes out of scope.2 min readRc<T>, RefCell<T>, and how Rc<RefCell<T>> lets several owners mutate shared data. It also assumes you have seen how a reference cycle keeps strong counts above zero, so the values are never freed.2 min readRc<T>, RefCell<T>, and the basics of spawning threads with std::thread. It shows the thread-safe counterparts of those two types.2 min readBox<T>, Rc<T>, RefCell<T>, Cell<T>, Weak<T>, Arc<T>, and Mutex<T>. It gives you a way to pick among them. It does not introduce new types.2 min read