October 2019
Intermediate to advanced
444 pages
10h 37m
English
In just a few steps, we'll explore immutable states:
use std::thread;use std::rc::Rc;use std::sync::Arc;use std::sync::mpsc::channel;fn noop<T>(_: T) {}
fn main() { let (sender, receiver) = channel::<usize>(); thread::spawn(move || { let thread_local_read_only_clone = sender.clone(); noop(thread_local_read_only_clone); });}