Name the rules of ownership.
List all built-in copy types.
List the rules of references.
List all available enum variants.
List the module rules.
List the privacy rules.
Types allowing shared ownership.
How do Rc/Weak and Arc work?
Name two types that all enable interior mutability.
Cell & RefCell
How can you access a copy of the value contained in a Cell?
fn get(&self) -> T
with T: Copy
How can you change the value contained in a Cell?
fn set(&self, val: T)
with T: Copy
What is the difference between a Cell and a RefCell?
Cell does not let you call mut methods on it’s contained values and its values need to implement the Copy trait.
How can you get access to the value contained in a std::cell::RefCell?
What happens when the rules of reference are violated with the help of a RefCell?
The borrow and borrow_mut methods panic.
How is the RefMut type used?
RefMut can be used as a mutable reference of the contained type.
How can you spawn a new thread?
std::thread::spawn(|| { println!(“hello”); })
the argument is a FnOnce closure