Skip to content

Rc practice problems in Rust

Difficulty:
Category:
Tag:

Showing 12 of 12

Status Title Difficulty
Bake-off: the same tree, an arena and an `Rc` graph Hard
Build Rc<T> and RefCell<T> from scratch Hard
Dispatch through Rc: Rc<dyn Trait> and shared behaviour Medium
Inside `Rc`: `strong_count`, `ptr_eq`, `get_mut`, `try_unwrap` Medium
RAII: build your own guard Medium
`Rc::make_mut`: copy-on-write shared data Hard
`Rc::new_cyclic`: self-reference in one step Hard
`Rc<RefCell<T>>`: the workhorse, and when it is a smell Hard
`Rc<str>`: interning without double indirection Medium
`Rc<T>`: shared ownership by reference counting Medium
Reference cycles leak memory Hard
`Weak<T>`: non-owning references that break cycles Hard