๐ Rust Rc and Arc
= pointer types, which allow sharing ownership of values
When to use which?
Rc
- owned values are immutable
Example
use std::rc::Rc;
// Rust can infer all these types; written out for clarity
let s: Rc<String> = Rc::new("shirataki".to_string());
let t: Rc<String> = s.clone();
let u: Rc<String> = s.clone();