Loading tutorials
move closures capture values, and how to start a thread with std::thread::spawn and wait for it with JoinHandle::join. It explains what kind of trait Send and Sync are, where they live, and how they show up in co5 min readmove, and the basics of thread::spawn and JoinHandle. It covers Send, the trait that decides whether a value can move to another thread. Sync, auto traits and manual unsafe impl have their own chapters, so5 min readSync trait. It assumes you know ownership, borrowing and lifetimes, traits and trait bounds, closures with move, and the basics of std::thread::spawn and JoinHandle. The previous chapter covered Send, which is about moving a value to another thread. Sync is about 5 min readmove closures, can read trait bounds such as T: Send + 'static, and have used thread::spawn and JoinHandle. Earlier chapters covered what Send promises and how the compiler derives it automatically. Here you learn which types opt out, why each on5 min readSend and Sync promise, that T: Sync means &T: Send, and that auto traits derive from fields. It covers which standard types are not Sync, why, and how to fix the errors they cause.5 min readSend and Sync are defined, that Cell and RefCell are not Sync, and that Rc is neither Send nor Sync. It also assumes you can use thread::spawn, Arc, and move closures. Here you will see how three standard library tools get around those restrict5 min readmove closures, and basic use of thread::spawn and JoinHandle. You should also know what Send and Sync each promise. Send means a value can move to another thread. Sync means &T can be shared with another thread.5 min readmove, and the basics of thread::spawn and JoinHandle. It also assumes you know what Send and Sync promise. Here you will see how those traits and the 'static lifetime bound combine in the signat4 min readthread::spawn, JoinHandle, move closures, and the Send and Sync rules from the earlier chapters. Here you will see how thread::scope lets threads borrow local data, and why the Send and Sync bounds still apply.5 min readmove closures, and basic use of thread::spawn. You should also know what Send and Sync promise and which standard types opt out. Here the focus is the compiler's output: how to find the real cause in a long message and pick5 min readSend and Sync promise, how auto traits derive them from fields, and why *mut T and Rc<T> opt out. You should also be comfortable with unsafe blocks, Drop, and Box::into_raw and Box::from_raw. Here you learn when a manual implementation is justified 5 min readSend and Sync from a type's fields. It also assumes you can read an unsafe impl. Here you will make your own types refuse to cross threads, and learn when that is the right call.5 min readSend and Sync guarantee, how auto traits are derived, and the basics of async/await on the Tokio runtime. It covers why a future can be !Send, how to read the error, and how to fix it.5 min read